selectSite.vue 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. <template>
  2. <view>
  3. <navigator class="site" v-for="(item, i) in account_list" :key="item.userid" url="#" @click="selectSite(i)">
  4. {{ item.sitename }}-{{ item.name }}
  5. </navigator>
  6. </view>
  7. </template>
  8. <script>
  9. import { loginMsg } from "./modules/dispose";
  10. export default {
  11. name: "SelectSite",
  12. data() {
  13. return {
  14. account_list: uni.getStorageSync('account_list')
  15. }
  16. },
  17. methods: {
  18. selectSite(index) {
  19. let that = this,
  20. site = this.account_list[index];
  21. uni.showModal({
  22. title: '提示',
  23. content: `是否确定登录“${site.sitename}”站点的“${site.name}”账号`,
  24. success: ({ confirm }) => {
  25. if (confirm) loginMsg([site], that, false);
  26. }
  27. })
  28. },
  29. },
  30. }
  31. </script>
  32. <style lang="scss" scoped>
  33. .site {
  34. width: 345px;
  35. border-radius: 4px;
  36. background: #fff;
  37. padding: 10px 15px;
  38. box-sizing: border-box;
  39. margin: 10px auto;
  40. font-size: 14px;
  41. color: #333333;
  42. }
  43. </style>