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

354 lines
7.7 KiB

6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
4 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
4 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
6 months ago
5 months ago
4 months ago
4 months ago
4 months ago
6 months ago
3 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
4 months ago
6 months ago
6 months ago
5 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
5 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
6 months ago
  1. <template>
  2. <view class="page">
  3. <view class="head-box"></view>
  4. <uv-navbar :title="$t('pages.index.center.nav_title')" leftIcon=" " :bgColor="bgColor" height="100rpx" :titleStyle="{color:'#fff'}"></uv-navbar>
  5. <!-- 个人中心 -->
  6. <view class="content">
  7. <view class="head" @click="toInfo">
  8. <view class="headImage" @click="toInfo">
  9. <image :src="userInfo.headImage" mode="aspectFill"></image>
  10. </view>
  11. <view class="info" @click="toInfo">
  12. <view class="vip">
  13. {{isLogin ? userInfo.nickName : $t('pages.index.center.please_login')}}
  14. <!-- 请点击登录 -->
  15. </view>
  16. <view class="tips">
  17. {{ userInfo.phone || '' }}
  18. </view>
  19. </view>
  20. <view class="setting" @click="toInfo">
  21. <uv-icon name="edit-pen" size="50rpx" color="#fff"></uv-icon>
  22. </view>
  23. </view>
  24. <view class="myOrder">
  25. <view>{{ $t('pages.index.center.my_activities') }}</view>
  26. <!-- 我的活动 -->
  27. </view>
  28. <view class="order">
  29. <view class="box">
  30. <!-- @click="$utils.navigateTo('/pages_my/activeList') -->
  31. <view class="boxs"
  32. @click="orderJump(1)">
  33. <image src="@/static/image/center/order-1.png" mode="aspectFill" />
  34. <view>{{ $t('pages.index.center.pending') }}</view>
  35. <!-- 待参加 -->
  36. </view>
  37. <view class="boxs"
  38. @click="orderJump(2)">
  39. <image src="@/static/image/center/order-2.png" mode="aspectFill" />
  40. <view>{{ $t('pages.index.center.completed') }}</view>
  41. <!-- 已完成 -->
  42. </view>
  43. <view class="boxs"
  44. @click="orderJump(3)">
  45. <image src="@/static/image/center/order-3.png" mode="aspectFill" />
  46. <view>{{ $t('pages.index.center.cancelled') }}</view>
  47. <!-- 已取消 -->
  48. </view>
  49. </view>
  50. </view>
  51. <view class="myOrder">
  52. <view>{{ $t('pages.index.center.my_tools') }}</view>
  53. <!-- 我的工具 -->
  54. </view>
  55. <view class="user">
  56. <view class="cell-bottom">
  57. <view class="cell-line"
  58. v-if="(!item.role || userInfo.isUser == 'Y')
  59. && (!item.auth || isLogin)"
  60. v-for="(item,i) in cellList"
  61. :key="i" @click="jump(item)">
  62. <view class="line-l">
  63. <image :src="item.src" mode="widthFix"></image>
  64. <view>{{item.name}}</view>
  65. </view>
  66. <uv-icon size="35" name="arrow-right"></uv-icon>
  67. </view>
  68. </view>
  69. </view>
  70. </view>
  71. <!-- <customerServicePopup ref="customerServicePopup"/> -->
  72. <tabber select="center" />
  73. </view>
  74. </template>
  75. <script>
  76. import tabber from '@/components/base/tabbar.vue'
  77. import { mapState,mapGetters } from 'vuex'
  78. import customerServicePopup from '@/components/config/customerServicePopup.vue'
  79. export default {
  80. components: {
  81. tabber,
  82. customerServicePopup,
  83. },
  84. computed: {
  85. ...mapGetters(["userInfo","isLogin"]),
  86. },
  87. data() {
  88. return {
  89. bgColor:'transparent',
  90. cellList:[],
  91. vipType : ['普通会员', '黄金会员', '渠道商'],
  92. vipImage : ['vip_vip', 'vip_user', 'vip_shop']
  93. }
  94. },
  95. onShow() {
  96. if(this.isLogin) {
  97. this.$store.commit('getUserInfo')
  98. }
  99. },
  100. onLoad() {
  101. // 初始化国际化的菜单列表
  102. this.cellList = [
  103. {
  104. src:require('@/static/image/center/line-1.png'),
  105. name: this.$t('pages.index.center.invoice_records'), // 开票记录
  106. url:'/pages_order/invoiceRecords'
  107. },
  108. {
  109. src:require('@/static/image/center/line-2.png'),
  110. name: this.$t('pages.index.center.my_favorites'), // 我的收藏
  111. url:'/pages_my/collection'
  112. },
  113. {
  114. src:require('@/static/image/center/line-3.png'),
  115. name: this.$t('pages.index.center.about_us'), // 关于我们
  116. url:'/pages_my/guanyuwomen'
  117. },
  118. {
  119. src:require('@/static/image/center/line-4.png'),
  120. name: this.$t('pages.index.center.user_agreement'), // 用户协议
  121. url:'/pages_login/fuwutiaokuan'
  122. },
  123. {
  124. src:require('@/static/image/center/line-5.png'),
  125. name: this.$t('pages.index.center.privacy_policy'), // 隐私协议
  126. url:'/pages_login/yinsixieyi'
  127. },
  128. {
  129. src:require('@/static/image/center/line-6.png'),
  130. name: this.$t('pages.index.center.organizer_agreement'), // 主理人协议
  131. url:'/pages_my/zlx-xieyi'
  132. },
  133. {
  134. src:require('@/static/image/center/line-7.png'),
  135. name: this.$t('pages.index.center.organizer_checkin'), // 主理人签到
  136. url:'/pages_my/zlx-qiandao',
  137. role : true,
  138. },
  139. {
  140. src: '/static/image/center/line-5.png',
  141. name: this.$t('pages.index.center.logout'), // 退出登录
  142. commit : 'logout',
  143. auth : true,
  144. }
  145. ]
  146. },
  147. onPageScroll(e) {
  148. if(e.scrollTop > 50) {
  149. this.bgColor = '#49070c'
  150. }else{
  151. this.bgColor = 'transparent'
  152. }
  153. },
  154. methods: {
  155. orderJump(type) {
  156. uni.switchTab({
  157. url:'/pages/index/cart'
  158. })
  159. uni.setStorageSync('currentState',type)
  160. },
  161. clickNo(){
  162. uni.showModal({
  163. title: '暂未开放',
  164. })
  165. },
  166. jump(item) {
  167. if(item.commit){
  168. this.$store.commit(item.commit)
  169. return
  170. }
  171. uni.navigateTo({
  172. url:item.url
  173. })
  174. },
  175. toInfo() {
  176. if(!this.isLogin) {
  177. uni.navigateTo({
  178. url:'/pages_login/wxLogin'
  179. })
  180. }else{
  181. uni.navigateTo({
  182. url:'/pages_my/user-info'
  183. })
  184. }
  185. }
  186. }
  187. }
  188. </script>
  189. <style lang="scss">
  190. page {
  191. background-color: #060504;
  192. }
  193. </style>
  194. <style scoped lang="scss">
  195. .page {
  196. .head-box {
  197. background: url('@/static/image/nav-bg.png') no-repeat;
  198. background-size: 100% 100%;
  199. width: 100%;
  200. height: 534rpx;
  201. position: absolute;
  202. z-index: -1;
  203. }
  204. .content {
  205. padding: 0 30rpx;
  206. padding-top: calc(var(--status-bar-height) + 110rpx);
  207. padding-bottom: 20rpx;
  208. }
  209. }
  210. .head {
  211. display: flex;
  212. align-items: center;
  213. margin-bottom: 40rpx;
  214. .headImage {
  215. width: 113rpx;
  216. height: 113rpx;
  217. background-image: url(/static/image/center/3.png);
  218. background-size: 100% 100%;
  219. overflow: hidden;
  220. border-radius: 50%;
  221. margin-right: 22rpx;
  222. image {
  223. width: 100%;
  224. height: 100%;
  225. }
  226. }
  227. .info {
  228. font-size: 28rpx;
  229. display: flex;
  230. flex-direction: column;
  231. gap: 10rpx;
  232. flex: 1;
  233. .vip {
  234. font-weight: 600;
  235. font-size: 32rpx;
  236. color: #E6E6E6;
  237. }
  238. .tips {
  239. font-weight: 400;
  240. font-size: 22rpx;
  241. color: #999999;
  242. }
  243. }
  244. }
  245. .setting {
  246. display: flex;
  247. align-items: center;
  248. justify-content: center;
  249. // position: absolute;
  250. // right: 50rpx;
  251. // top: 50rpx;
  252. width: 70rpx;
  253. height: 70rpx;
  254. background: #221D1D;
  255. border-radius: 20rpx;
  256. }
  257. .myOrder {
  258. font-weight: bold;
  259. font-size: 28rpx;
  260. color: #E6E6E6;
  261. }
  262. .order {
  263. display: flex;
  264. align-items: center;
  265. justify-content: center;
  266. height: 200rpx;
  267. background: #1B1713;
  268. border-radius: 20rpx 20rpx 20rpx 20rpx;
  269. opacity: 0.7;
  270. color: #999999;
  271. font-size: 23rpx;
  272. margin-top: 22rpx;
  273. margin-bottom: 33rpx;
  274. .box {
  275. display: flex;
  276. width: 100%;
  277. justify-content: space-around;
  278. .boxs {
  279. width: 33.33%;
  280. display: flex;
  281. flex-direction: column;
  282. align-items: center;
  283. border-right: 1px solid #2F2D2B;
  284. &:last-child {
  285. border: none;
  286. }
  287. image {
  288. width: 55rpx;
  289. height: 47rpx;
  290. margin-bottom: 24rpx;
  291. }
  292. }
  293. }
  294. }
  295. .user {
  296. margin-top: 25rpx;
  297. .grid {
  298. flex-direction: column;
  299. font-size: 26rpx;
  300. padding: 20rpx;
  301. .title {
  302. font-weight: 600;
  303. padding: 10rpx;
  304. border-left: 6rpx solid #A3D250;
  305. }
  306. }
  307. .cell-bottom {
  308. margin-top: 20rpx;
  309. margin-left: 2%;
  310. background-color: #1B1713;
  311. border-radius: 20rpx;
  312. .cell-line {
  313. height: 100rpx;
  314. display: flex;
  315. align-items: center;
  316. justify-content: space-between;
  317. padding: 0 30rpx;
  318. .line-l {
  319. display: flex;
  320. align-items: center;
  321. font-weight: 400;
  322. font-size: 29rpx;
  323. color: #E6E6E6;
  324. image {
  325. width: 45rpx;
  326. margin-right: 18rpx;
  327. }
  328. }
  329. }
  330. }
  331. }
  332. </style>