铝交易,微信公众号
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

329 lines
7.3 KiB

2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
2 months ago
4 months ago
4 months ago
2 months ago
4 months ago
2 months ago
1 month ago
2 months ago
1 month ago
2 months ago
4 months ago
2 months ago
4 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
2 months ago
1 month ago
2 months ago
2 months ago
2 months ago
  1. <template>
  2. <view class="page">
  3. <navbar :title="$t('pageTitle.personalCenter')" />
  4. <view class="frame">
  5. <!-- 头部 -->
  6. <view class="head">
  7. <view class="headImage">
  8. <image src="1" mode=""></image>
  9. </view>
  10. <view class="change"
  11. v-if="!userInfo.id"
  12. @click="$utils.toLogin">
  13. 登录
  14. </view>
  15. <view class="info"
  16. v-else
  17. @click="toUpdateInfo">
  18. <view class="name"
  19. v-if="userShop">
  20. 供应商{{shopData.companyName}}
  21. <uv-icon
  22. name="edit-pen"
  23. color="#fff"
  24. size="30"></uv-icon>
  25. </view>
  26. <view class="name"
  27. v-else>
  28. 采购商{{buy.companyName}}
  29. <uv-icon
  30. name="edit-pen"
  31. color="#fff"
  32. size="30"></uv-icon>
  33. </view>
  34. <view class="tips">
  35. {{ $t('components.phoneNumber') }} {{userInfo.phone}}
  36. </view>
  37. </view>
  38. <!-- <view class="headBtn" @click="headBtn">
  39. {{ $t('components.roleSwitching') }}
  40. </view> -->
  41. <!-- <view class="setting">
  42. <uv-icon name="setting" size="40rpx"></uv-icon>
  43. </view> -->
  44. </view>
  45. <view class=""
  46. style="color: #aaa;
  47. text-align: center;line-height: 100rpx;"
  48. v-if="!userInfo.id">
  49. 请先完成登录解锁更多功能
  50. </view>
  51. <!-- 供应商 -->
  52. <view class="supplier" v-else-if="userShop">
  53. <centerList :list="supplierList" @open="openCustomerServicePopup" @about="$refs.popup.open('gywm')">
  54. </centerList>
  55. </view>
  56. <!-- 采购商 -->
  57. <view class="purchaser" v-else>
  58. <centerList :list="purchaserList" @open="openCustomerServicePopup" @about="$refs.popup.open('gywm')">
  59. </centerList>
  60. </view>
  61. </view>
  62. <!-- 联系客服弹框 -->
  63. <customerServicePopup ref="customerServicePopup" />
  64. <uv-action-sheet
  65. ref="actionSheet"
  66. :actions="actionSheetList"
  67. @select="actionSheetSelect">
  68. </uv-action-sheet>
  69. <configPopup ref="popup"></configPopup>
  70. <tabber select="3" />
  71. </view>
  72. </template>
  73. <script>
  74. import topbar from "@/components/base/topbar.vue";
  75. import tabber from "@/components/base/tabbar.vue";
  76. import centerList from "@/components/base/centerList.vue";
  77. import customerServicePopup from "@/components/config/customerServicePopup.vue";
  78. import {
  79. mapGetters,
  80. mapState
  81. } from 'vuex'
  82. export default {
  83. name: "center2",
  84. components: {
  85. customerServicePopup,
  86. tabber,
  87. topbar,
  88. centerList
  89. },
  90. computed: {
  91. ...mapGetters(['userShop']),
  92. ...mapState(["userInfo", 'shopData', 'buy']),
  93. },
  94. data() {
  95. return {
  96. // 供应商
  97. supplierList: [
  98. {
  99. text: `${this.$t('other.Myorder')}`,
  100. englishText: 'Myorder',
  101. value: ">",
  102. imgUrl: '/static/image/center/14.svg',
  103. toPathUrl: '/pages_order/order/myOrders'
  104. },
  105. {
  106. text: `${this.$t('pageTitle.myOrders')}`,
  107. englishText: 'myOrders',
  108. value: ">",
  109. imgUrl: '/static/image/center/14.svg',
  110. toPathUrl: '/pages_order/order/pendingOrder'
  111. },
  112. {
  113. text: `${this.$t('components.contactCustomerService')}`,
  114. englishText: 'contactCustomerService',
  115. value: ">",
  116. imgUrl: '/static/image/center/13.svg'
  117. },
  118. {
  119. text: `${this.$t('components.systemSettings')}`,
  120. englishText: 'systemSettings',
  121. value: ">",
  122. imgUrl: '/static/image/center/12.svg',
  123. toPathUrl: '/pages_order/center/systemSet'
  124. },
  125. {
  126. text: `${this.$t('components.helpFeedback')}`,
  127. englishText: 'systemSettings',
  128. value: ">",
  129. imgUrl: '/static/image/center/12.svg',
  130. toPathUrl: '/pages_order/center/helpFeedback'
  131. },
  132. {
  133. text: `${this.$t('components.aboutUs')}`,
  134. englishText: 'aboutUs',
  135. value: ">",
  136. imgUrl: '/static/image/center/13.svg'
  137. },
  138. ],
  139. // 采购商
  140. purchaserList: [
  141. // this.$t('pages.index.index.companyProfile')
  142. {
  143. text: `${this.$t('other.Myorder')}`,
  144. englishText: 'Myorder',
  145. value: ">",
  146. imgUrl: '/static/image/center/14.svg',
  147. toPathUrl: '/pages_order/order/myOrders'
  148. },
  149. {
  150. text: `${this.$t('components.contactCustomerService')}`,
  151. englishText: 'contactCustomerService',
  152. value: ">",
  153. imgUrl: '/static/image/center/13.svg'
  154. },
  155. {
  156. text: `${this.$t('components.systemSettings')}`,
  157. englishText: 'systemSettings',
  158. value: ">",
  159. imgUrl: '/static/image/center/12.svg',
  160. toPathUrl: '/pages_order/center/systemSet'
  161. },
  162. {
  163. text: `${this.$t('components.helpFeedback')}`,
  164. englishText: 'systemSettings',
  165. value: ">",
  166. imgUrl: '/static/image/center/12.svg',
  167. toPathUrl: '/pages_order/center/helpFeedback'
  168. },
  169. {
  170. text: `${this.$t('components.aboutUs')}`,
  171. englishText: 'aboutUs',
  172. value: ">",
  173. imgUrl: '/static/image/center/13.svg'
  174. },
  175. ],
  176. actionSheetList: [
  177. {
  178. name : '修改供应商信息',
  179. key : 'shopData',
  180. },
  181. {
  182. name : '修改采购商信息',
  183. key : 'buy',
  184. },
  185. ],
  186. }
  187. },
  188. onShow() {
  189. if(uni.getStorageSync('token')){
  190. this.$store.commit('getUserInfo')
  191. }
  192. },
  193. methods: {
  194. openCustomerServicePopup() {
  195. console.log("打开客服弹框")
  196. this.$refs.customerServicePopup.open();
  197. },
  198. toUpdateInfo(){
  199. if(this.buy && this.shopData){
  200. this.$refs.actionSheet.open()
  201. }else if(this.buy){
  202. uni.navigateTo({
  203. url: '/pages_order/auth/registerShop?key=buy'
  204. })
  205. }else if(this.shopData){
  206. uni.navigateTo({
  207. url: '/pages_order/auth/registerShop?key=shopData'
  208. })
  209. }
  210. },
  211. actionSheetSelect(e){
  212. uni.navigateTo({
  213. url: '/pages_order/auth/registerShop?key=' + e.key
  214. })
  215. },
  216. },
  217. }
  218. </script>
  219. <style scoped lang="scss">
  220. .page {
  221. background-color: #2e2e2e;
  222. height: calc(100vh - 120rpx);
  223. .frame {
  224. background-color: #2e2e2e;
  225. .head {
  226. display: flex;
  227. background-color: $uni-color;
  228. padding: 40rpx 20rpx;
  229. align-items: center;
  230. position: relative;
  231. color: #fff;
  232. box-shadow: 0 10rpx 20rpx rgba(89, 80, 80, 0.1);
  233. .headImage {
  234. width: 120rpx;
  235. height: 120rpx;
  236. background-image: url(/static/image/center/3.png);
  237. background-size: 100% 100%;
  238. overflow: hidden;
  239. border-radius: 50%;
  240. margin-right: 40rpx;
  241. }
  242. .change {
  243. display: flex;
  244. align-items: center;
  245. justify-content: center;
  246. width: 30%;
  247. height: 70rpx;
  248. border-radius: 40rpx;
  249. color: white;
  250. font-size: 28rpx;
  251. margin: 20rpx 10rpx 0 0;
  252. background: $uni-color;
  253. border: 1px solid #757986;
  254. //margin-top: 20rpx;
  255. border-radius: 40rpx;
  256. }
  257. .info {
  258. font-size: 28rpx;
  259. .vip {
  260. background-color: #FCCC92;
  261. color: #FA6239;
  262. width: 100rpx;
  263. display: flex;
  264. justify-content: center;
  265. align-items: center;
  266. height: 40rpx;
  267. border-radius: 20rpx;
  268. margin-top: 20rpx;
  269. }
  270. .name {
  271. font-size: 26rpx;
  272. display: flex;
  273. align-items: center;
  274. }
  275. .tips {
  276. font-size: 26rpx;
  277. color: #ABABAB;
  278. }
  279. }
  280. .headBtn {
  281. margin-left: auto;
  282. padding: 15rpx 20rpx;
  283. background-color: $uni-color;
  284. color: #fff;
  285. border-radius: 20rpx;
  286. margin-top: 50rpx;
  287. }
  288. .setting {
  289. position: absolute;
  290. right: 50rpx;
  291. top: 50rpx;
  292. }
  293. }
  294. .supplier {}
  295. .purchaser {}
  296. }
  297. }
  298. </style>