TapList.vue 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <template>
  2. <view>
  3. <!-- 预约列表 -->
  4. <view class="appointList">
  5. <template>
  6. <u-cell
  7. v-for="item in isLinkList1"
  8. :key="item.id"
  9. :border="false"
  10. :icon="item.icon"
  11. :title="item.title"
  12. isLink
  13. :url="item.url"
  14. />
  15. </template>
  16. </view>
  17. <view class="other-out-box">
  18. <u-cell
  19. v-for="item in isLinkList2"
  20. :key="item.id"
  21. :border="false"
  22. :icon="item.icon"
  23. :title="item.title"
  24. :isLink="item.isLink"
  25. :url="item.url"
  26. @click="handleCellClick(item)"
  27. />
  28. </view>
  29. <u-modal
  30. :show="showSwitchDialog"
  31. :showCancelButton="true"
  32. :title="title"
  33. :content="content"
  34. @confirm="confirmSwitch"
  35. @cancel="cancelSwitch"
  36. ></u-modal>
  37. </view>
  38. </template>
  39. <script>
  40. import { getMerchantAuthData } from '@/api/merchant/merchantAuth';
  41. export default {
  42. data() {
  43. return {
  44. isLinkList1: [
  45. {
  46. id: '0',
  47. icon: 'list-dot',
  48. title: '预约列表',
  49. url: '/PageMine/goodsReserve/index',
  50. },
  51. // ,
  52. // {
  53. // id: '1',
  54. // icon: 'list',
  55. // title: '询价列表',
  56. // url: '/pages/client/clientUser/inquiryList',
  57. // },
  58. ],
  59. isLinkList2: [
  60. {
  61. id: '0',
  62. icon: 'home-fill',
  63. title: '我的店铺',
  64. url: '',
  65. isLink: true,
  66. },
  67. {
  68. id: '1',
  69. icon: 'plus-people-fill',
  70. title: '我的团队',
  71. url: '/PageMine/myTeam/index',
  72. isLink: true,
  73. },
  74. {
  75. id: '2',
  76. icon: 'server-man',
  77. title: '客服中心',
  78. url: '/PageMine/serviceCenter/index',
  79. isLink: true,
  80. },
  81. {
  82. id: '3',
  83. icon: 'share-square',
  84. title: '意见反馈',
  85. url: '/PageMine/feedback/index',
  86. isLink: true,
  87. },
  88. {
  89. id: '4',
  90. icon: 'thumb-up',
  91. title: '关于我们',
  92. url: '/PageMine/about/index',
  93. isLink: true,
  94. },
  95. ],
  96. showSwitchDialog: false,
  97. title: '提醒',
  98. content: '您确定要从用户端切换到商家端吗?',
  99. };
  100. },
  101. methods: {
  102. handleCellClick(item) {
  103. console.log('item', item);
  104. if (item.id == 0) {
  105. this.showSwitchDialog = true;
  106. } else {
  107. // console.log('点击了非链接项');
  108. }
  109. },
  110. //点击取消时
  111. cancelSwitch() {
  112. this.showSwitchDialog = false;
  113. this.title = '提醒';
  114. this.content = '您确定要从用户端切换到商家端吗?';
  115. },
  116. // 点击确认时
  117. confirmSwitch() {
  118. if (this.title == '提醒') {
  119. this.getMerchantAuth();
  120. } else if (this.title == '警告!') {
  121. //进入审核未通过详情
  122. uni.navigateTo({
  123. url: 'pageMerchant/mineModule/openStoreAppealDetail',
  124. });
  125. this.cancelSwitch();
  126. } else {
  127. // 进入开店流程页面
  128. uni.navigateTo({
  129. url: '/pageMerchant/mineModule/certification/index',
  130. });
  131. this.cancelSwitch();
  132. }
  133. },
  134. /*===========================================================*/
  135. // 获取商家信息
  136. async getMerchantAuth() {
  137. let res = await getMerchantAuthData();
  138. if (res.code === 'OK' && res.data) {
  139. console.log(res, '获取商家信息');
  140. this.$store.dispatch('SwitchIdentity', 'MERCHANT');
  141. // 将数据存储到vuex中
  142. this.merchantInfo = Object.assign(
  143. {},
  144. {
  145. ...res.data,
  146. mobileNumber: res.data.mobileNumber,
  147. },
  148. );
  149. this.$store.commit('SET_MERCHANTINFO', res.data);
  150. if (res.data.reviewStatus == 2) {
  151. //跳转认证中页面
  152. uni.navigateTo({
  153. // url: '/pageMerchant/mineModule/certification/openStoreAppealDetail'
  154. url: 'pageMerchant/mineModule/openStoreAppealDetail',
  155. });
  156. this.cancelSwitch();
  157. } else if (res.data.reviewStatus == 1) {
  158. uni.navigateTo({
  159. url: '/pageMerchant/index',
  160. });
  161. this.cancelSwitch();
  162. } else {
  163. this.title = '警告!';
  164. this.content = `认证未通过, ${
  165. res.data.message ? '审核意见:' + res.data.message : ''
  166. }. 点击确认进入查看信息`;
  167. }
  168. } else {
  169. this.title = '温馨提示!';
  170. this.content = '您还没有自己的店铺,如果您确定要开店,请点击确定进入开店流程';
  171. }
  172. },
  173. },
  174. };
  175. </script>
  176. <style lang="scss" scoped>
  177. .appointList {
  178. margin: 20rpx;
  179. padding: 20rpx 10rpx;
  180. border-radius: 10rpx;
  181. background-color: #fff;
  182. }
  183. .other-out-box {
  184. margin: 20rpx;
  185. padding: 20rpx 10rpx;
  186. border-radius: 10rpx;
  187. margin-top: 0;
  188. box-sizing: border-box;
  189. background-color: $uni-bg-color;
  190. }
  191. </style>