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

463 lines
12 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="flex flex-column 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="isMerchants" 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="isMerchants" 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. isMerchants() {
  161. return this.userInfo.isMerchants === '1'
  162. },
  163. },
  164. data() {
  165. return {
  166. }
  167. },
  168. onShow() {
  169. this.$store.commit('getUserInfo')
  170. this.$store.commit('getRiceInfo')
  171. },
  172. methods: {
  173. clickNo() {
  174. uni.showModal({
  175. title: '暂未开放',
  176. })
  177. },
  178. logout(){
  179. uni.showModal({
  180. title: '确认退出登录吗',
  181. success : (r) => {
  182. if (r.confirm) {
  183. this.$store.commit('logout', true)
  184. }
  185. }
  186. })
  187. },
  188. openServicePopup(phone, title) {
  189. // todo
  190. this.$refs.customerServicePopup.open(phone, title)
  191. },
  192. onScan() {
  193. // todo check
  194. uni.scanCode({
  195. success: (res) => {
  196. console.log(res);
  197. if (res.result) {
  198. // 处理扫码结果
  199. console.log('扫码结果:', res.result);
  200. this.$fetch('overOrder', res.result).then(() => {
  201. uni.showToast({
  202. title: '核销成功',
  203. icon: 'none'
  204. })
  205. })
  206. }
  207. },
  208. fail: (err) => {
  209. console.error('扫码失败:', err);
  210. uni.showToast({
  211. title: '扫码失败',
  212. icon: 'none'
  213. })
  214. }
  215. });
  216. },
  217. }
  218. }
  219. </script>
  220. <style scoped lang="scss">
  221. .page {
  222. background-color: #F5F5F5;
  223. .header {
  224. height: 550rpx;
  225. background-image: linear-gradient(#84A73F, #D8FF8F);
  226. justify-content: flex-start;
  227. position: relative;
  228. }
  229. }
  230. .user {
  231. margin-top: 123rpx;
  232. &-avatar {
  233. width: 115rpx;
  234. height: 115rpx;
  235. border-radius: 50%;
  236. }
  237. &-name {
  238. margin-top: 4rpx;
  239. color: $uni-text-color-inverse;
  240. font-size: 30rpx;
  241. text-align: center;
  242. }
  243. }
  244. .member {
  245. width: calc(100vw - 13rpx*2);
  246. position: absolute;
  247. bottom: 0;
  248. left: 13rpx;
  249. color: #F5F5F5;
  250. font-size: 22rpx;
  251. background-color: #2B2C30;
  252. border-top-left-radius: 20rpx;
  253. border-top-right-radius: 20rpx;
  254. &-overview {
  255. min-height: 81rpx;
  256. justify-content: space-between;
  257. &.is-member {
  258. justify-content: flex-start;
  259. }
  260. }
  261. .icon {
  262. height: auto;
  263. &-crown {
  264. width: 35rpx;
  265. margin-left: 20rpx;
  266. }
  267. &-member {
  268. width: 62rpx;
  269. }
  270. &-role {
  271. width: 156rpx;
  272. margin-right: 15rpx;
  273. }
  274. &-rights {
  275. width: 56rpx;
  276. margin-right: 11rpx;
  277. }
  278. }
  279. &-btn {
  280. padding: 9rpx 17rpx;
  281. color: #000000;
  282. font-size: 22rpx;
  283. background-image: linear-gradient(131deg, #F8EDE1, #B3997E);
  284. box-shadow: 0rpx 3rpx 6rpx 0rpx rgba(0,0,0,0.16);
  285. border-radius: 24rpx;
  286. margin-right: 18rpx;
  287. }
  288. &-tips {
  289. margin-left: 6rpx;
  290. }
  291. &-rights {
  292. background-color: #37393D;
  293. position: relative;
  294. width: 100%;
  295. height: 142rpx;
  296. box-sizing: border-box;
  297. &-bg {
  298. width: 100%;
  299. height: 100%;
  300. }
  301. &-content {
  302. position: absolute;
  303. bottom: 0;
  304. width: 100%;
  305. height: 100%;
  306. box-sizing: border-box;
  307. padding: 0 35rpx 6rpx 35rpx;
  308. justify-content: space-between;
  309. }
  310. &-label {
  311. color: #CBAD8F;
  312. font-size: 22rpx;
  313. font-weight: 700;
  314. }
  315. &-value {
  316. color: #F5F5F5;
  317. font-size: 18rpx;
  318. }
  319. }
  320. }
  321. .card {
  322. margin: 20rpx 13rpx 0 13rpx;
  323. }
  324. .account {
  325. padding: 40rpx 40rpx 23rpx 40rpx;
  326. justify-content: space-between;
  327. &-label {
  328. color: #666666;
  329. font-size: 28rpx;
  330. margin-top: 9rpx;
  331. }
  332. &-value {
  333. color: #000000;
  334. font-size: 32rpx;
  335. }
  336. &-unit {
  337. color: #666666;
  338. font-size: 18rpx;
  339. margin-left: 2rpx;
  340. }
  341. }
  342. .fun {
  343. &-header {
  344. text-align: left;
  345. padding-left: 12rpx;
  346. margin-bottom: 19rpx;
  347. /deep/ .title__view {
  348. display: inline-flex;
  349. }
  350. }
  351. &-content {
  352. margin-top: 24rpx;
  353. }
  354. &-common {
  355. padding: 30rpx 40rpx 67rpx 40rpx;
  356. &-content {
  357. display: grid;
  358. grid-template-columns: repeat(4, 1fr);
  359. grid-column-gap: 71rpx;
  360. grid-row-gap: 81rpx;
  361. }
  362. &-icon {
  363. width: 66rpx;
  364. height: auto;
  365. }
  366. &-label {
  367. color: #000000;
  368. font-size: 28rpx;
  369. margin-top: 5rpx;
  370. }
  371. }
  372. &-merchant {
  373. padding: 33rpx 30rpx 28rpx 30rpx;
  374. margin-bottom: 10rpx;
  375. &-content {
  376. justify-content: space-between;
  377. }
  378. .left {
  379. width: 198rpx;
  380. height: 139rpx;
  381. position: relative;
  382. &-bg {
  383. width: 100%;
  384. height: 100%;
  385. }
  386. &-content {
  387. position: absolute;
  388. top: 13rpx;
  389. left: 14rpx;
  390. color: $uni-text-color-inverse;
  391. font-size: 28rpx;
  392. }
  393. &-icon {
  394. width: 23rpx;
  395. height: auto;
  396. margin-left: 9rpx;
  397. }
  398. }
  399. .right {
  400. width: 429rpx;
  401. height: 164rpx;
  402. margin-top: -25rpx;
  403. &-bg {
  404. width: 100%;
  405. height: 100%;
  406. }
  407. }
  408. }
  409. }
  410. </style>