推拿小程序前端代码仓库
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.

448 lines
11 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view class="page">
  3. <view class="flex flex-column header">
  4. <view class="user">
  5. <image class="user-avatar" :src="userInfo.headImage" mode="aspectFill"></image>
  6. <view class="user-name">{{ userInfo.nickName }}</view>
  7. </view>
  8. <view class="member">
  9. <view class="flex member-overview" :class="[role ? 'is-member' : '']">
  10. <template v-if="role">
  11. <!-- todo: 缺切图 "皇冠" -->
  12. <image class="icon icon-crown" src="" mode="widthFix"></image>
  13. <template v-if="role === 'member-personal'">
  14. <image class="icon icon-role" src="@/static/image/center/icon-member-personal.png" mode="widthFix"></image>
  15. </template>
  16. <template v-else-if="role === 'member-business'">
  17. <image class="icon icon-role" src="@/static/image/center/icon-member-business.png" mode="widthFix"></image>
  18. </template>
  19. <!-- todo: 换回接口字段 -->
  20. <text class="member-tips">{{ `将于${'2026-12-12'} 到期` }}</text>
  21. </template>
  22. <template v-else>
  23. <view class="flex">
  24. <!-- todo: 缺切图 "皇冠" -->
  25. <image class="icon icon-crown" src="" mode="widthFix"></image>
  26. <!-- todo: 缺切图 "会员" -->
  27. <image class="icon icon-member" src="" mode="widthFix"></image>
  28. <text class="member-tips">成为会员可获得会员卡享受会员福利哟~</text>
  29. </view>
  30. <button plain class="btn member-btn" @click="$utils.navigateTo('/pages_order/mine/memberCenter')">立即开通</button>
  31. </template>
  32. </view>
  33. <view class="member-rights">
  34. <image class="member-rights-bg" src="@/pages_order/static/center/member-bg.png" mode="top" ></image>
  35. <view class="flex member-rights-content">
  36. <view class="flex">
  37. <image class="icon icon-rights" src="@/static/image/center/icon-member-weal.png" mode="widthFix"></image>
  38. <view>
  39. <view class="member-rights-label">会员福利</view>
  40. <view class="member-rights-value">会员折扣</view>
  41. </view>
  42. </view>
  43. <view class="flex">
  44. <!-- todo: 缺切图 -->
  45. <image class="icon icon-rights" src="@/static/image/center/icon-member-weal.png" mode="widthFix"></image>
  46. <view>
  47. <view class="member-rights-label">会员积分</view>
  48. <view class="member-rights-value">兑换礼品</view>
  49. </view>
  50. </view>
  51. <!-- todo: 缺切图 -->
  52. <view class="flex">
  53. <image class="icon icon-rights" src="@/static/image/center/icon-member-weal.png" mode="widthFix"></image>
  54. <view>
  55. <view class="member-rights-label">会员优惠券</view>
  56. <view class="member-rights-value">满减折扣</view>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <!-- todo: check -> @click="$utils.navigateTo('/pages_order/mine/withdraw') -->
  64. <view class="card flex account">
  65. <view class="flex flex-column">
  66. <view class="account-value">{{ riceInfo.balance || 0 }}<text class="account-unit"></text></view>
  67. <view class="account-label">我的余额</view>
  68. </view>
  69. <view class="flex flex-column">
  70. <!-- todo: 字段对接 -->
  71. <view class="account-value">{{ riceInfo.balance || 0 }}</view>
  72. <view class="account-label">我的积分</view>
  73. </view>
  74. <view class="flex flex-column">
  75. <view class="account-value">{{ riceInfo.canWithdraw || 0 }}<text class="account-unit"></text></view>
  76. <view class="account-label">推广佣金</view>
  77. </view>
  78. <view class="flex flex-column">
  79. <!-- todo: 字段对接 -->
  80. <view class="account-value">{{ riceInfo.balance || 0 }}<text class="account-unit"></text></view>
  81. <view class="account-label">优惠券</view>
  82. </view>
  83. </view>
  84. <view class="card fun-common">
  85. <view v-if="userInfo.is_merchants" class="fun-header">
  86. <cardTitle>常用功能</cardTitle>
  87. </view>
  88. <view class="fun-content fun-common-content">
  89. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/memberCenter')">
  90. <image class="fun-common-icon" src="@/static/image/center/icon-member-center.png" mode="widthFix"></image>
  91. <text class="fun-common-label">会员中心</text>
  92. </view>
  93. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/partner')">
  94. <image class="fun-common-icon" src="@/static/image/center/icon-team.png" mode="widthFix"></image>
  95. <text class="fun-common-label">我的团队</text>
  96. </view>
  97. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/promotion')">
  98. <image class="fun-common-icon" src="@/static/image/center/icon-invite.png" mode="widthFix"></image>
  99. <text class="fun-common-label">邀请好友</text>
  100. </view>
  101. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/coupon')">
  102. <image class="fun-common-icon" src="@/static/image/center/icon-coupon.png" mode="widthFix"></image>
  103. <text class="fun-common-label">优惠券</text>
  104. </view>
  105. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/voucher')">
  106. <image class="fun-common-icon" src="@/static/image/center/icon-voucher.png" mode="widthFix"></image>
  107. <text class="fun-common-label">代金券</text>
  108. </view>
  109. <!-- todo: check -> @click="openServicePopup" -->
  110. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/home/contact')">
  111. <image class="fun-common-icon" src="@/static/image/center/icon-service.png" mode="widthFix"></image>
  112. <text class="fun-common-label">联系客服</text>
  113. </view>
  114. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/signIn')">
  115. <image class="fun-common-icon" src="@/static/image/center/icon-sign-in.png" mode="widthFix"></image>
  116. <text class="fun-common-label">每日签到</text>
  117. </view>
  118. <view class="flex flex-column" @click="$utils.navigateTo('/pages_order/mine/cooperation')">
  119. <image class="fun-common-icon" src="@/static/image/center/icon-cooperation.png" mode="widthFix"></image>
  120. <text class="fun-common-label">商家合作</text>
  121. </view>
  122. </view>
  123. </view>
  124. <view v-if="userInfo.is_merchants" class="card fun-merchant">
  125. <view class="fun-header">
  126. <cardTitle>商家功能</cardTitle>
  127. </view>
  128. <view class="flex fun-content fun-merchant-content">
  129. <view class="left" @click="$utils.navigateTo('/pages_order/mine/verifyRecord')">
  130. <image class="left-bg" src="@/static/image/center/bg-verify.png"></image>
  131. <view class="flex left-content">
  132. <text>核销明细</text>
  133. <image class="left-icon" src="@/static/image/center/icon-arrow.png" mode="widthFix"></image>
  134. </view>
  135. </view>
  136. <!-- todo -->
  137. <view class="right" @click="onScan">
  138. <image class="right-bg" src="@/static/image/center/bg-scan.png"></image>
  139. </view>
  140. </view>
  141. </view>
  142. <customerServicePopup ref="customerServicePopup" />
  143. <tabber select="center" />
  144. </view>
  145. </template>
  146. <script>
  147. import cardTitle from '@/components/base/cardTitle.vue'
  148. import tabber from '@/components/base/tabbar.vue'
  149. import { mapGetters, mapState } from 'vuex'
  150. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  151. export default {
  152. components: {
  153. cardTitle,
  154. tabber,
  155. customerServicePopup,
  156. },
  157. computed: {
  158. ...mapGetters(['role']),
  159. ...mapState(['userInfo', 'riceInfo']),
  160. },
  161. data() {
  162. return {
  163. }
  164. },
  165. onShow() {
  166. this.$store.commit('getUserInfo')
  167. this.$store.commit('getRiceInfo')
  168. },
  169. methods: {
  170. clickNo() {
  171. uni.showModal({
  172. title: '暂未开放',
  173. })
  174. },
  175. logout(){
  176. uni.showModal({
  177. title: '确认退出登录吗',
  178. success : (r) => {
  179. if (r.confirm) {
  180. this.$store.commit('logout', true)
  181. }
  182. }
  183. })
  184. },
  185. openServicePopup(phone, title) {
  186. // todo
  187. this.$refs.customerServicePopup.open(phone, title)
  188. },
  189. onScan() {
  190. // todo
  191. uni.scanCode({
  192. success: (res) => {
  193. console.log(res);
  194. if (res.result) {
  195. // 处理扫码结果
  196. console.log('扫码结果:', res.result);
  197. }
  198. },
  199. fail: (err) => {
  200. console.error('扫码失败:', err);
  201. }
  202. });
  203. },
  204. }
  205. }
  206. </script>
  207. <style scoped lang="scss">
  208. .page {
  209. background-color: #F5F5F5;
  210. .header {
  211. height: 550rpx;
  212. background-image: linear-gradient(#84A73F, #D8FF8F);
  213. justify-content: flex-start;
  214. position: relative;
  215. }
  216. }
  217. .user {
  218. margin-top: 123rpx;
  219. &-avatar {
  220. width: 115rpx;
  221. height: 115rpx;
  222. border-radius: 50%;
  223. }
  224. &-name {
  225. margin-top: 4rpx;
  226. color: $uni-text-color-inverse;
  227. font-size: 30rpx;
  228. text-align: center;
  229. }
  230. }
  231. .member {
  232. width: calc(100vw - 13rpx*2);
  233. position: absolute;
  234. bottom: 0;
  235. left: 13rpx;
  236. color: #F5F5F5;
  237. font-size: 22rpx;
  238. background-color: #2B2C30;
  239. border-top-left-radius: 20rpx;
  240. border-top-right-radius: 20rpx;
  241. &-overview {
  242. min-height: 81rpx;
  243. justify-content: space-between;
  244. &.is-member {
  245. justify-content: flex-start;
  246. }
  247. }
  248. .icon {
  249. height: auto;
  250. &-crown {
  251. width: 35rpx;
  252. margin-left: 20rpx;
  253. }
  254. &-member {
  255. width: 62rpx;
  256. }
  257. &-role {
  258. width: 156rpx;
  259. margin-right: 15rpx;
  260. }
  261. &-rights {
  262. width: 56rpx;
  263. margin-right: 11rpx;
  264. }
  265. }
  266. &-btn {
  267. padding: 9rpx 17rpx;
  268. color: #000000;
  269. font-size: 22rpx;
  270. background-image: linear-gradient(131deg, #F8EDE1, #B3997E);
  271. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  272. border-radius: 24rpx;
  273. margin-right: 18rpx;
  274. }
  275. &-tips {
  276. margin-left: 6rpx;
  277. }
  278. &-rights {
  279. background-color: #37393D;
  280. position: relative;
  281. width: 100%;
  282. height: 142rpx;
  283. box-sizing: border-box;
  284. &-bg {
  285. width: 100%;
  286. height: 100%;
  287. }
  288. &-content {
  289. position: absolute;
  290. bottom: 0;
  291. width: 100%;
  292. height: 100%;
  293. box-sizing: border-box;
  294. padding: 0 35rpx 6rpx 35rpx;
  295. justify-content: space-between;
  296. }
  297. &-label {
  298. color: #CBAD8F;
  299. font-size: 22rpx;
  300. font-weight: 700;
  301. }
  302. &-value {
  303. color: #F5F5F5;
  304. font-size: 18rpx;
  305. }
  306. }
  307. }
  308. .card {
  309. margin: 20rpx 13rpx 0 13rpx;
  310. }
  311. .account {
  312. padding: 40rpx 40rpx 23rpx 40rpx;
  313. justify-content: space-between;
  314. &-label {
  315. color: #666666;
  316. font-size: 28rpx;
  317. margin-top: 9rpx;
  318. }
  319. &-value {
  320. color: #000000;
  321. font-size: 32rpx;
  322. }
  323. &-unit {
  324. color: #666666;
  325. font-size: 18rpx;
  326. margin-left: 2rpx;
  327. }
  328. }
  329. .fun {
  330. &-header {
  331. text-align: left;
  332. padding-left: 12rpx;
  333. margin-bottom: 19rpx;
  334. /deep/ .title__view {
  335. display: inline-flex;
  336. }
  337. }
  338. &-content {
  339. margin-top: 24rpx;
  340. }
  341. &-common {
  342. padding: 30rpx 40rpx 67rpx 40rpx;
  343. &-content {
  344. display: grid;
  345. grid-template-columns: repeat(4, 1fr);
  346. grid-column-gap: 71rpx;
  347. grid-row-gap: 81rpx;
  348. }
  349. &-icon {
  350. width: 66rpx;
  351. height: auto;
  352. }
  353. &-label {
  354. color: #000000;
  355. font-size: 28rpx;
  356. margin-top: 5rpx;
  357. }
  358. }
  359. &-merchant {
  360. padding: 33rpx 30rpx 28rpx 30rpx;
  361. margin-bottom: 10rpx;
  362. &-content {
  363. justify-content: space-between;
  364. }
  365. .left {
  366. width: 198rpx;
  367. height: 139rpx;
  368. position: relative;
  369. &-bg {
  370. width: 100%;
  371. height: 100%;
  372. }
  373. &-content {
  374. position: absolute;
  375. top: 13rpx;
  376. left: 14rpx;
  377. color: $uni-text-color-inverse;
  378. font-size: 28rpx;
  379. }
  380. &-icon {
  381. width: 23rpx;
  382. height: auto;
  383. margin-left: 9rpx;
  384. }
  385. }
  386. .right {
  387. width: 429rpx;
  388. height: 164rpx;
  389. margin-top: -25rpx;
  390. &-bg {
  391. width: 100%;
  392. height: 100%;
  393. }
  394. }
  395. }
  396. }
  397. </style>