index.vue 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349
  1. <!-- 我的 -->
  2. <template>
  3. <view class="my" :style="{ background: 'url(' + bgImg + ') #F4F5F9' }">
  4. <view class="title">
  5. <image :src="logoImg" mode="heightFix"></image>
  6. </view>
  7. <view class="news">
  8. <image :src="avatarImg"></image>
  9. <view v-if="realName" class="phone">{{ realName }}</view>
  10. <view v-else class="phone" @click="toLogin()">未登录</view>
  11. </view>
  12. <view class="content">
  13. <view class="order-wrap">
  14. <!-- <view class="unpay">
  15. <view class="left">
  16. <image :src="tongzhi"></image>
  17. <view class="tip">您有1笔订单待付款<text>09:34</text>后取消</view>
  18. </view>
  19. <view class="right">去付款</view>
  20. </view> -->
  21. <view class="order">
  22. <view class="order_top">
  23. <text class="mytt">我的订单</text>
  24. <view class="myall" @click="toOrder(orderList[0])">
  25. <text class="all">全部</text>
  26. <image class="more" :src="moreImg"></image>
  27. </view>
  28. </view>
  29. <view class="order-box">
  30. <view class="order-box-item" v-for="(item, index) in orderList" :key="index" @click="toOrder(item)">
  31. <image :src="item.icon"></image>
  32. <text class="name">{{ item.label }}</text>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="cantact" @click="serviceVisible=true">
  38. <view class="canl">
  39. <image :src="cantact"></image>
  40. <text>联系客服</text>
  41. </view>
  42. <image class="more" :src="moreImg"></image>
  43. </view>
  44. <!-- <view v-if="realName" class="outline" @click="outLogin()">退出登录</view> -->
  45. </view>
  46. <u-modal :show="serviceVisible" title="联系客服" :closeOnClickOverlay="true" :showConfirmButton="false" @close="serviceVisible=false">
  47. <view class="slot-content">
  48. <view class="flex-center service-box">
  49. <img :src="wxchatImg" alt="">
  50. </view>
  51. </view>
  52. </u-modal>
  53. </view>
  54. </template>
  55. <script>
  56. import {logout} from '@/apis/user.js'
  57. export default {
  58. components: {},
  59. data() {
  60. return {
  61. serviceVisible: false,
  62. realName: uni.getStorageSync('realName'),
  63. token: uni.getStorageSync('token'),
  64. wxchatImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_kefu.png",
  65. bgImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/bg_top%403x.png",
  66. logoImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/img_logo%403x.png",
  67. tongzhi: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_tongzhi%403x.png",
  68. moreImg: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_more%403x.png",
  69. cantact: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_kefurexian%403x.png",
  70. avatarImg: 'https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_avatar.png',
  71. orderList: [
  72. {
  73. value: '',
  74. label: '全部',
  75. index: 0,
  76. icon: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_diankaguanli%403x.png"
  77. },
  78. {
  79. value: 'WAIT_PAYMENT',
  80. label: '待付款',
  81. index: 1,
  82. icon: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_daifukuan%403x.png"
  83. },
  84. {
  85. value: 'SHOOTING',
  86. label: '拍摄中',
  87. index: 3,
  88. icon: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_daifukuan%403x.png"
  89. },
  90. {
  91. value: 'DELIVERED',
  92. label: '已交付',
  93. index: 5,
  94. icon: "https://ovp-shop.oss-cn-hangzhou.aliyuncs.com/static/9dshop/ic_daifukuan%403x.png"
  95. }
  96. ]
  97. };
  98. },
  99. computed: {},
  100. watch: {},
  101. onLoad() {
  102. },
  103. onShow() {
  104. this.changeTabbar()
  105. },
  106. methods: {
  107. changeTabbar() {
  108. uni.setTabBarStyle({
  109. color: '#9EA3B1',
  110. selectedColor: '#0D121A',
  111. backgroundColor: '#FFF'
  112. })
  113. },
  114. toOrder(item) {
  115. this.$router.push({
  116. path: '/pages/order/index?status='+item.value+'&current='+item.index
  117. })
  118. },
  119. outLogin() {
  120. logout().then(res => {
  121. uni.removeStorageSync('token')
  122. uni.removeStorageSync('realName')
  123. // const cleanUrl = window.location.pathname + window.location.hash;
  124. // window.history.replaceState({}, '', cleanUrl);
  125. this.$router.push({
  126. path: '/pages/index/index'
  127. })
  128. })
  129. },
  130. },
  131. created() {
  132. },
  133. mounted() {
  134. },
  135. }
  136. </script>
  137. <style lang='scss' scoped>
  138. .my {
  139. width: 100%;
  140. // height: 100%;
  141. display: flex;
  142. flex-direction: column;
  143. position: absolute;
  144. top: 0;
  145. bottom: 0;
  146. background-size: contain !important;
  147. background-repeat: no-repeat !important;
  148. background-position: top;
  149. .title {
  150. padding: 16rpx 32rpx;
  151. image {
  152. height: 56rpx;
  153. }
  154. }
  155. .news {
  156. padding: 64rpx 48rpx 0;
  157. display: flex;
  158. align-items: center;
  159. image {
  160. width: 104rpx;
  161. height: 104rpx;
  162. background-color: aqua;
  163. border-radius: 50%;
  164. }
  165. .phone {
  166. font-weight: bold;
  167. font-size: 44rpx;
  168. color: #0D121A;
  169. margin-left: 32rpx;
  170. }
  171. }
  172. .content {
  173. padding: 0 24rpx;
  174. margin-top: 40rpx;
  175. box-sizing: content-box;
  176. }
  177. .more {
  178. width: 32rpx;
  179. height: 32rpx;
  180. }
  181. .order-wrap {
  182. width: 100%;
  183. display: flex;
  184. flex-direction: column;
  185. align-items: center;
  186. .unpay {
  187. // box-sizing: border-box;
  188. width: 638rpx;
  189. background: #FFEEE2;
  190. border-radius: 24rpx 24rpx 0rpx 0rpx;
  191. border: 2rpx solid #FFFEFD;
  192. padding: 16rpx 18rpx 16rpx 16rpx;
  193. display: flex;
  194. justify-content: space-between;
  195. align-items: center;
  196. .left {
  197. display: flex;
  198. align-items: center;
  199. image {
  200. width: 48rpx;
  201. height: 48rpx;
  202. }
  203. .tip {
  204. font-size: 24rpx;
  205. color: #FF7441;
  206. margin-left: 14rpx;
  207. text {
  208. font-weight: bold;
  209. }
  210. }
  211. }
  212. .right {
  213. width: 120rpx;
  214. height: 44rpx;
  215. font-weight: 500;
  216. background: #FF7441;
  217. border-radius: 24rpx;
  218. font-size: 24rpx;
  219. color: #FFFFFF;
  220. text-align: center;
  221. line-height: 44rpx;
  222. }
  223. }
  224. .order {
  225. padding: 32rpx 32rpx 40rpx;
  226. width: 100%;
  227. box-sizing: border-box;
  228. height: 260rpx;
  229. background: linear-gradient(180deg, #DEF5FD 0%, #FFFFFF 100%);
  230. border-radius: 32rpx;
  231. border: 2rpx solid #FFFFFF;
  232. .order_top {
  233. display: flex;
  234. justify-content: space-between;
  235. align-items: center;
  236. .mytt {
  237. font-weight: 500;
  238. font-size: 32rpx;
  239. color: #0D121A;
  240. }
  241. .myall {
  242. font-weight: 400;
  243. font-size: 26rpx;
  244. color: #0D121A;
  245. display: flex;
  246. align-items: center;
  247. .all {
  248. margin-right: 8rpx;
  249. }
  250. }
  251. }
  252. .order-box {
  253. display: flex;
  254. justify-content: space-between;
  255. align-items: center;
  256. margin-top: 48rpx;
  257. .order-box-item {
  258. display: flex;
  259. flex-direction: column;
  260. align-items: center;
  261. width: 128rpx;
  262. image {
  263. width: 64rpx;
  264. height: 64rpx;
  265. }
  266. .name {
  267. font-size: 24rpx;
  268. color: #0D121A;
  269. margin-top: 16rpx;
  270. }
  271. }
  272. }
  273. }
  274. }
  275. .cantact {
  276. width: 100%;
  277. height: 112rpx;
  278. background: #FFFFFF;
  279. border-radius: 24rpx;
  280. display: flex;
  281. justify-content: space-between;
  282. align-items: center;
  283. padding: 24rpx 32rpx;
  284. margin-top: 24rpx;
  285. .canl {
  286. display: flex;
  287. align-items: center;
  288. image {
  289. margin-right: 24rpx;
  290. width: 64rpx;
  291. height: 64rpx;
  292. }
  293. }
  294. }
  295. .outline {
  296. width: 622rpx;
  297. height: 96rpx;
  298. border-radius: 36rpx;
  299. border: 4rpx solid #E2E4EB;
  300. font-size: 28rpx;
  301. color: #0D121A;
  302. text-align: center;
  303. line-height: 96rpx;
  304. margin: 48rpx auto;
  305. }
  306. }
  307. .service-box {
  308. padding: 32rpx;
  309. }
  310. .service-box img {
  311. width: 300rpx;
  312. // height: 300rpx;
  313. }
  314. </style>