mine - 副本.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553
  1. <template>
  2. <view class="container" style="background-image: url('https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img19.png');">
  3. <u-navbar title="我的" leftIconColor="#ffffff" titleStyle="color:#fff" :autoBack="true" placeholder>
  4. <view class="u-nav-slot" slot="left" @click="goPath('/pages/mine/news')">
  5. <text class="iconfont icon-tongzhi"></text>
  6. <view v-if="noticeCount>0">{{noticeCount<100?noticeCount:99}}</view>
  7. </view>
  8. </u-navbar>
  9. <view class="userBox">
  10. <view class="userBox_img">
  11. <image :src="userInfo.headPhoto" mode="" v-if="userInfo.headPhoto" />
  12. <image src="@/static/default-head-photo.png" mode="" v-else />
  13. </view>
  14. <view class="userBox_info" v-if="userInfo.nickname">
  15. <view class="userBox_info_t">{{userInfo.nickname}}</view>
  16. <view class="userBox_info_b" @click="goPath('/pages/mine/personalDetails')">编辑资料
  17. <text class="iconfont icon-jiantou"></text>
  18. </view>
  19. </view>
  20. <view class="userBox_info" v-else @click="goLogin()">
  21. <view class="userBox_info_t">登录</view>
  22. </view>
  23. <image src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img20.png" mode="" />
  24. </view>
  25. <view class="pointsBox">
  26. <view style="background-image: url('https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img21.png');">
  27. <view class="pointsBox_l">
  28. <image src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img22.png" mode="" />
  29. 礼包兑换豆
  30. <view>
  31. 可用: <text>{{userInfo.integralAble}}</text>
  32. </view>
  33. </view>
  34. <view class="pointsBox_r" @click="goPath('/pages/giftPackageCenter/pointsDetails')">
  35. 查看明细
  36. <text class="iconfont icon-jiantou"></text>
  37. </view>
  38. </view>
  39. </view>
  40. <view class="box">
  41. <view class="orderType">
  42. <view class="orderType_title">礼包兑换订单</view>
  43. <view class="orderType_list">
  44. <view class="orderType_item" @click="goPath('/pages/mine/exchangeOrder?orderStatus=10')">
  45. <image src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img23.png" mode="" />
  46. <view>待发货</view>
  47. <view class="num" v-if="shoporderCountObj.wait_shipped&&shoporderCountObj.wait_shipped>0">{{shoporderCountObj.wait_shipped||0}}</view>
  48. </view>
  49. <view class="orderType_item" @click="goPath('/pages/mine/exchangeOrder?orderStatus=20')">
  50. <image style="width:61rpx;height:51rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img24.png" mode="" />
  51. <view>已发货</view>
  52. <view class="num " v-if="shoporderCountObj.wait_received&&shoporderCountObj.wait_received>0">{{shoporderCountObj.wait_received||0}}</view>
  53. </view>
  54. <view class="orderType_item" @click="goPath('/pages/mine/exchangeOrder?orderStatus=30')">
  55. <image style="width:62rpx;height:61rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img25.png" mode="" />
  56. <view>已完成</view>
  57. </view>
  58. <view class="orderType_item" @click="goPath('/pages/mine/exchangeOrder')">
  59. <image style="width:49rpx;height:49rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img26.png" mode="" />
  60. <view>全部</view>
  61. </view>
  62. </view>
  63. </view>
  64. <view class="navList">
  65. <view class="navList_item" @click="goPath('/pages/mine/myRedEn')">
  66. <view class="navList_item_l">
  67. <view>
  68. <image src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img27.png" mode="" />
  69. </view>
  70. 我的红包
  71. </view>
  72. <view class="navList_item_r">
  73. 已获得:
  74. <text class="red">¥{{userRedPacketCount||0}}</text>
  75. <text class="iconfont icon-jiantou"></text>
  76. </view>
  77. </view>
  78. <view class="navList_item" @click="goPath('/pages/mine/myFavorite')">
  79. <view class="navList_item_l">
  80. <view>
  81. <image style="width:39rpx;height:38rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img28.png" mode="" />
  82. </view>
  83. 我的收藏
  84. </view>
  85. <view class="navList_item_r">
  86. <text class="iconfont icon-jiantou"></text>
  87. </view>
  88. </view>
  89. <view class="navList_item" @click="goPath('/pages/home/touristInfo')">
  90. <view class="navList_item_l">
  91. <view>
  92. <image style="width:36rpx;height:39rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img29.png" mode="" />
  93. </view>
  94. 游客信息
  95. </view>
  96. <view class="navList_item_r">
  97. <text class="iconfont icon-jiantou"></text>
  98. </view>
  99. </view>
  100. <view class="navList_item" @click="goPath('/pages/giftPackageCenter/shippingAddress')">
  101. <view class="navList_item_l">
  102. <view>
  103. <image style="width:34rpx;height:36rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img30.png" mode="" />
  104. </view>
  105. 收货地址
  106. </view>
  107. <view class="navList_item_r">
  108. <text class="iconfont icon-jiantou"></text>
  109. </view>
  110. </view>
  111. <view class="navList_item" @click="goPath('/pages/mine/promotionCenter')" v-if="promotioncheck">
  112. <view class="navList_item_l">
  113. <view>
  114. <image style="width:30rpx;height:37rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img31.png" mode="" />
  115. </view>
  116. 推广中心
  117. </view>
  118. <view class="navList_item_r">
  119. <text class="iconfont icon-jiantou"></text>
  120. </view>
  121. </view>
  122. <view class="navList_item" @click="goPath('/pages/mine/set')">
  123. <view class="navList_item_l">
  124. <view>
  125. <image style="width:36rpx;height:36rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img32.png" mode="" />
  126. </view>
  127. 设置中心
  128. </view>
  129. <view class="navList_item_r">
  130. <text class="iconfont icon-jiantou"></text>
  131. </view>
  132. </view>
  133. <button id="bindId" type="default" style="display:none" open-type="contact"></button>
  134. <label class="navList_item" @click="openService()" for="bindId">
  135. <view class="navList_item_l">
  136. <view>
  137. <image style="width:34rpx;height:34rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img33.png" mode="" />
  138. </view>
  139. 微信客服
  140. </view>
  141. <view class="navList_item_r">
  142. <text class="iconfont icon-jiantou"></text>
  143. </view>
  144. </label>
  145. <view class="navList_item" @click="goSellerCenter()">
  146. <view class="navList_item_l">
  147. <view>
  148. <image style="width:36rpx;height:39rpx" src="https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img29.png" mode="" />
  149. </view>
  150. 商户中心
  151. </view>
  152. <view class="navList_item_r">
  153. <text class="iconfont icon-jiantou"></text>
  154. </view>
  155. </view>
  156. </view>
  157. <view class="tag">粤ICP备2025370029号-2X</view>
  158. </view>
  159. <tabBar currentPage="/pages/tabBar/mine" />
  160. </view>
  161. </template>
  162. <script>
  163. import tabBar from '@/components/tabBar/index.vue'
  164. import {
  165. userInfo,
  166. userNoticeCount,
  167. promotioncheck,
  168. totalRedPacket,
  169. shoporderCount
  170. } from "@/api/user.js"
  171. import {
  172. UserInfo
  173. } from "@/utils/tools.js"
  174. export default {
  175. components: {
  176. tabBar
  177. },
  178. data () {
  179. return {
  180. userInfo: {},
  181. noticeCount: 0,
  182. promotioncheck: false,
  183. userRedPacketCount: 0,
  184. shoporderCountObj: {},
  185. }
  186. },
  187. onLoad () {
  188. },
  189. onShow () {
  190. this.init()
  191. },
  192. onPullDownRefresh () {
  193. this.init()
  194. },
  195. // 分享
  196. async onShareAppMessage (res) {
  197. let data = await this.$utils.getConfigShare()
  198. return {
  199. title: data.shareTitle || '同样价格买门票,超额补贴等你拿',
  200. path: "pages/tabBar/home",
  201. imageUrl: data.shareImage?(data.shareImage+'?x-oss-process=style/w_300') :
  202. 'https://wx.qlogo.cn/mmhead/zsUXYY6y4cKZWvEkWNfqaciaPd00ia4wztvPMURtP26puM7uM9P9beWSDBIg4zBj0RicSangIZ6DIM/0'
  203. }
  204. },
  205. // 分享朋友圈
  206. async onShareTimeline () {
  207. let data = await this.$utils.getConfigShare()
  208. return {
  209. title: data.shareTitle || '同样价格买门票,超额补贴等你拿',
  210. query: 'pages/tabBar/home',
  211. imageUrl: data.shareImage?(data.shareImage+'?x-oss-process=style/w_300' ):
  212. 'https://wx.qlogo.cn/mmhead/zsUXYY6y4cKZWvEkWNfqaciaPd00ia4wztvPMURtP26puM7uM9P9beWSDBIg4zBj0RicSangIZ6DIM/0'
  213. };
  214. },
  215. methods: {
  216. init () {
  217. let token = uni.getStorageSync('apiToken');
  218. if (token) {
  219. this.getUserInfo();
  220. this.getUserNoticeCount();
  221. this.promotioncheckFun();
  222. this.getMyRedTotal();
  223. this.getShoporderCount()
  224. }
  225. },
  226. // 礼包兑换订单统计
  227. getShoporderCount () {
  228. shoporderCount().then(res => {
  229. this.shoporderCountObj = res.data
  230. })
  231. },
  232. goLogin () {
  233. uni.reLaunch({
  234. url: '/pages/login/index',
  235. });
  236. },
  237. goSellerCenter () {
  238. let Authorization = uni.getStorageSync('Authorization');
  239. if (Authorization) {
  240. uni.navigateTo({
  241. url: '/pages/sellerCenter/index',
  242. })
  243. } else {
  244. uni.navigateTo({
  245. url: '/pages/sellerCenter/login',
  246. })
  247. }
  248. },
  249. promotioncheckFun () {
  250. promotioncheck().then(res => {
  251. this.promotioncheck = res.data
  252. })
  253. },
  254. getMyRedTotal () {
  255. totalRedPacket().then(res => {
  256. this.userRedPacketCount = res.data.userRedPacketCount
  257. })
  258. },
  259. getUserInfo () {
  260. UserInfo().then(res => {
  261. this.userInfo = res;
  262. }).finally(()=>{
  263. uni.stopPullDownRefresh();
  264. })
  265. },
  266. getUserNoticeCount () {
  267. userNoticeCount().then(res => {
  268. this.noticeCount = res.data
  269. })
  270. },
  271. goPath (path) {
  272. uni.navigateTo({
  273. url: path
  274. })
  275. },
  276. openService () {
  277. wx.openCustomerServiceChat({
  278. extInfo: {
  279. url: ''
  280. },
  281. corpId: '',
  282. success (res) { },
  283. complete (e) {
  284. console.log(e)
  285. }
  286. })
  287. },
  288. },
  289. }
  290. </script>
  291. <style lang='scss' scoped>
  292. ::v-deep .u-navbar__content,
  293. ::v-deep .u-status-bar {
  294. background-color: transparent !important;
  295. background-image: url("https://guess-shop.oss-cn-beijing.aliyuncs.com/static/online/img19.png");
  296. background-size: 100% 590rpx;
  297. }
  298. .container {
  299. background-size: 100% 610rpx;
  300. background-repeat: no-repeat;
  301. padding-bottom: 80rpx;
  302. .u-nav-slot {
  303. position: relative;
  304. .iconfont {
  305. font-size: 50rpx;
  306. color: #fff;
  307. }
  308. > view {
  309. color: #fff;
  310. background: #fb0b03;
  311. border-radius: 50%;
  312. border: 4rpx solid #fff;
  313. position: absolute;
  314. top: -6rpx;
  315. left: 26rpx;
  316. font-size: 22rpx;
  317. min-width: 23rpx;
  318. height: 23rpx;
  319. text-align: center;
  320. line-height: 25rpx;
  321. padding: 2rpx;
  322. }
  323. }
  324. .userBox {
  325. padding: 43rpx 30rpx 55rpx;
  326. display: flex;
  327. align-items: center;
  328. position: relative;
  329. .userBox_img {
  330. margin-right: 33rpx;
  331. image {
  332. width: 126rpx;
  333. height: 126rpx;
  334. border: 4rpx solid #fff;
  335. border-radius: 50%;
  336. }
  337. }
  338. .userBox_info {
  339. .userBox_info_t {
  340. font-size: 32rpx;
  341. color: #ffffff;
  342. font-family: FZCuYuan-M03;
  343. }
  344. .userBox_info_b {
  345. display: inline-block;
  346. margin-top: 13rpx;
  347. font-size: 22rpx;
  348. color: #fff;
  349. background: rgba(0, 0, 0, 0.3);
  350. border-radius: 25rpx;
  351. padding: 10rpx 25rpx;
  352. text {
  353. font-size: 22rpx;
  354. }
  355. }
  356. }
  357. > image {
  358. width: 257rpx;
  359. height: 217rpx;
  360. position: absolute;
  361. bottom: -15rpx;
  362. right: 30rpx;
  363. }
  364. }
  365. .pointsBox {
  366. padding: 0 30rpx;
  367. position: relative;
  368. z-index: 2;
  369. > view {
  370. padding: 0 20rpx 20rpx;
  371. background-size: 100% 146rpx;
  372. height: 146rpx;
  373. display: flex;
  374. align-items: center;
  375. justify-content: space-between;
  376. box-sizing: border-box;
  377. .pointsBox_l {
  378. font-size: 30rpx;
  379. color: #6d2a08;
  380. display: flex;
  381. align-items: center;
  382. image {
  383. width: 47rpx;
  384. height: 69rpx;
  385. margin-bottom: 26rpx;
  386. margin-right: 7rpx;
  387. }
  388. > view {
  389. font-size: 28rpx;
  390. color: #8d502e;
  391. padding-left: 30rpx;
  392. text {
  393. font-size: 32rpx;
  394. color: #fb0b03;
  395. font-family: FZCuYuan-M03;
  396. }
  397. }
  398. }
  399. .pointsBox_r {
  400. width: 156rpx;
  401. height: 54rpx;
  402. background: linear-gradient(90deg, #77320d, #ab4c1c);
  403. border-radius: 27rpx;
  404. text-align: center;
  405. line-height: 54rpx;
  406. font-size: 22rpx;
  407. color: #ffffff;
  408. text {
  409. font-size: 24rpx;
  410. display: inline-block;
  411. }
  412. }
  413. }
  414. }
  415. .box {
  416. background: #f6f6f6;
  417. border-radius: 40rpx 40rpx 0rpx 0rpx;
  418. position: relative;
  419. top: -35rpx;
  420. z-index: 5;
  421. padding: 30rpx 30rpx 100rpx 30rpx;
  422. .orderType {
  423. padding: 40rpx 19rpx 50rpx;
  424. background: #ffffff;
  425. border-radius: 20rpx;
  426. .orderType_title {
  427. font-size: 31rpx;
  428. color: #1a1a1a;
  429. font-family: FZCuYuan-M03;
  430. margin-bottom: 40rpx;
  431. }
  432. .orderType_list {
  433. display: flex;
  434. justify-content: space-between;
  435. align-items: baseline;
  436. .orderType_item {
  437. text-align: center;
  438. position: relative;
  439. image {
  440. width: 57rpx;
  441. height: 50rpx;
  442. }
  443. > view {
  444. font-size: 30rpx;
  445. color: #4d4d4d;
  446. margin-top: 20rpx;
  447. }
  448. > .num {
  449. color: #fff;
  450. background: #fb0b03;
  451. border-radius: 50%;
  452. border: 4rpx solid #fff;
  453. position: absolute;
  454. top: -34rpx;
  455. right: -2rpx;
  456. font-size: 22rpx;
  457. min-width: 38rpx;
  458. height: 38rpx;
  459. // text-align: center;
  460. // line-height: 30rpx;
  461. padding: 2rpx;
  462. box-sizing: border-box;
  463. display: flex;
  464. justify-content: center;
  465. align-items: center;
  466. }
  467. }
  468. }
  469. }
  470. .navList {
  471. .navList_item {
  472. display: flex;
  473. align-items: center;
  474. justify-content: space-between;
  475. margin-top: 50rpx;
  476. .navList_item_l {
  477. display: flex;
  478. align-items: center;
  479. font-size: 28rpx;
  480. color: #1a1a1a;
  481. > view {
  482. width: 38rpx;
  483. margin-right: 16rpx;
  484. image {
  485. width: 34rpx;
  486. height: 40rpx;
  487. }
  488. }
  489. }
  490. .navList_item_r {
  491. font-size: 28rpx;
  492. color: #808080;
  493. .red {
  494. font-size: 28rpx;
  495. color: #fb0b03;
  496. }
  497. .icon-jiantou {
  498. display: inline-block;
  499. margin-left: 10rpx;
  500. }
  501. }
  502. }
  503. }
  504. }
  505. .tag {
  506. width: 100%;
  507. font-size: 24rpx;
  508. color: #ccc;
  509. text-align: center;
  510. position: relative;
  511. bottom: -60rpx;
  512. }
  513. }
  514. .font18 {
  515. font-size: 18rpx !important;
  516. }
  517. </style>