center.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <view>
  3. <view style="background-color:#E75F37;height: 250rpx;">
  4. <view style="padding: 33rpx;display: flex;align-items: center;">
  5. <view class="">
  6. <image src="/static/images/tabBar/head.png" style="width:100rpx;height: 100rpx;" mode="scaleToFill">
  7. </image>
  8. </view>
  9. <view style="color:#fff;margin-left: 13rpx;font-size: 30rpx;font-weight: 500;">
  10. {{name?name:''}}
  11. </view>
  12. </view>
  13. </view>
  14. <view class="card" style="height: 114rpx;">
  15. <view style="display: flex;justify-content: space-around;align-items: center;height: 114rpx;">
  16. <!-- <text style="color:#818181;font-size: 24rpx;">
  17. 产生积分:
  18. <text style="color:#FE8301;font-size: 26rpx;">
  19. {{form.addPoints?form.addPoints:'0.00'}}
  20. </text>
  21. </text>
  22. <text style="color:#818181;font-size: 24rpx;">
  23. 使用积分:
  24. <text style="color:#FE8301;font-size: 26rpx;">
  25. {{form.subPoints?form.subPoints:'0.00'}}
  26. </text>
  27. </text>-->
  28. <text style="color:#818181;font-size: 24rpx;">
  29. 积分余额:
  30. <text style="color:#FE8301;font-size: 26rpx;">
  31. {{form.pointsBalance?form.pointsBalance:'0.00'}}
  32. </text>
  33. </text>
  34. <text style="color:#818181;font-size: 24rpx;">
  35. 现金余额:
  36. <text style="color:#FE8301;font-size: 26rpx;">
  37. {{form.recoveredBalance?form.recoveredBalance:'0.00'}}
  38. </text>
  39. </text>
  40. </view>
  41. </view>
  42. <view class="card" style="margin-top: 20rpx;height: 141rpx;">
  43. <view style="display: flex;justify-content: space-around;align-items: center;height: 141rpx;">
  44. <view style="display: flex;flex-direction:column;align-items: center;" @click="clickIntegralOrder">
  45. <image src="/static/images/tabBar/280-1.png" style="width:40rpx;height: 40rpx;" mode="scaleToFill">
  46. </image>
  47. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">积分订单
  48. <uni-icons type="right" size="13" color='#8A8A8A'></uni-icons>
  49. </view>
  50. </view>
  51. <view style="display: flex;flex-direction:column;align-items: center;" @click="inIntegralMall">
  52. <image src="/static/images/tabBar/280-2.png" style="width:40rpx;height: 40rpx;" mode="scaleToFill">
  53. </image>
  54. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;" >积分商城
  55. <uni-icons type="right" size="13" color='#8A8A8A'></uni-icons>
  56. </view>
  57. </view>
  58. <view style="display: flex;flex-direction:column;align-items: center;" @click="RedemptionOfPoints">
  59. <image src="/static/images/tabBar/280-3.png" style="width:40rpx;height: 40rpx;" mode="scaleToFill">
  60. </image>
  61. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">我的积分
  62. <uni-icons type="right" size="13" color='#8A8A8A'></uni-icons>
  63. </view>
  64. </view>
  65. </view>
  66. </view>
  67. <view class="card" style="margin-top: 20rpx;height: 238rpx;padding: 20rpx 0;">
  68. <u-cell-group :border="false">
  69. <u-cell title="我的订单" value="查看全部订单" :border="false" :clickable="false" @click="pageJump('')">
  70. <view slot="right-icon">
  71. <uni-icons type="right" size="18" color='#D2D2D2'></uni-icons>
  72. </view>
  73. </u-cell>
  74. </u-cell-group>
  75. <view style="display: flex;justify-content: space-around;">
  76. <view style="display: flex;flex-direction:column;align-items: center;" @click="obligationBtn('待付款')">
  77. <image src="/static/images/tabBar/280@2x(1).png" style="width:81rpx;height: 81rpx;"
  78. mode="scaleToFill">
  79. </image>
  80. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">待付款</view>
  81. </view>
  82. <view style="display: flex;flex-direction:column;align-items: center;" @click="pageJump('待发货')">
  83. <image src="/static/images/tabBar/280@2x(2).png" style="width:81rpx;height: 81rpx;"
  84. mode="scaleToFill">
  85. </image>
  86. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">待发货</view>
  87. </view>
  88. <view style="display: flex;flex-direction:column;align-items: center;" @click="pageJump('待收货')">
  89. <image src="/static/images/tabBar/280@2x(3).png" style="width:81rpx;height: 81rpx;"
  90. mode="scaleToFill">
  91. </image>
  92. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">待收货</view>
  93. </view>
  94. <view style="display: flex;flex-direction:column;align-items: center;" @click="pageJump('已收货')">
  95. <image src="/static/images/tabBar/280@2x(4).png" style="width:81rpx;height: 81rpx;"
  96. mode="scaleToFill">
  97. </image>
  98. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">已完成</view>
  99. </view>
  100. <view style="display: flex;flex-direction:column;align-items: center;" @click="pageJump('退款售后')">
  101. <image src="/static/images/tabBar/280@2x(5).png" style="width:81rpx;height: 81rpx;"
  102. mode="scaleToFill">
  103. </image>
  104. <view style="color: #414141;font-size: 26rpx;margin-top: 13rpx;">退款/售后</view>
  105. </view>
  106. </view>
  107. </view>
  108. <view class="card2" style="margin-top: 20rpx;display: flex;align-items: center;">
  109. <u-cell-group :border="false">
  110. <u-cell title="个人资料" :clickable="true" @click="clickMeans">
  111. <view slot="icon">
  112. <image src="/static/images/tabBar/100.png"
  113. style="width:26rpx;height: 27rpx;margin-right: 10rpx;" mode="scaleToFill">
  114. </image>
  115. </view>
  116. <view slot="right-icon">
  117. <uni-icons type="right" size="18" color='#CCCCCC'></uni-icons>
  118. </view>
  119. </u-cell>
  120. <u-cell title="员工信息" :clickable="true" @click="clickContacts">
  121. <view slot="icon">
  122. <image src="/static/images/tabBar/101.png"
  123. style="width:26rpx;height: 27rpx;margin-right: 10rpx;" mode="scaleToFill">
  124. </image>
  125. </view>
  126. <view slot="right-icon">
  127. <uni-icons type="right" size="18" color='#CCCCCC'></uni-icons>
  128. </view>
  129. </u-cell>
  130. <u-cell title="地址管理" :clickable="true" @click="clickAddress">
  131. <view slot="icon">
  132. <image src="/static/images/tabBar/102.png"
  133. style="width:26rpx;height: 27rpx;margin-right: 10rpx;" mode="scaleToFill">
  134. </image>
  135. </view>
  136. <view slot="right-icon">
  137. <uni-icons type="right" size="18" color='#CCCCCC'></uni-icons>
  138. </view>
  139. </u-cell>
  140. <u-cell title="设置" :clickable="true" :border="false" @click="setUp">
  141. <view slot="icon">
  142. <image src="/static/images/tabBar/103.png"
  143. style="width:26rpx;height: 27rpx;margin-right: 10rpx;" mode="scaleToFill">
  144. </image>
  145. </view>
  146. <view slot="right-icon">
  147. <uni-icons type="right" size="18" color='#CCCCCC'></uni-icons>
  148. </view>
  149. </u-cell>
  150. </u-cell-group>
  151. </view>
  152. <!-- 提取去登录 -->
  153. <u-modal :show="adminShow" :showCancelButton="true" content='当前还未登录请先登录!!' @confirm="adminConfirm"
  154. @cancel="adminCancel"></u-modal>
  155. </view>
  156. </template>
  157. <script>
  158. import {
  159. details,
  160. corpPointsDetail
  161. } from '@/api/views/personalInformation/index.js'
  162. export default {
  163. data() {
  164. return {
  165. name: null,
  166. badgeList: [],
  167. form: {},
  168. adminShow: false,
  169. }
  170. },
  171. onShow() {
  172. this.getUpdate()
  173. if (uni.getStorageSync('userInfo').tenant_id == '000000') {
  174. this.adminShow = true
  175. }
  176. details().then(res => {
  177. this.name = res.data.cname
  178. corpPointsDetail({
  179. corpId: res.data.id
  180. }).then(e => {
  181. this.form = e.data
  182. this.form.recoveredBalance = res.data.recoveredBalance
  183. })
  184. })
  185. },
  186. methods: {
  187. getUpdate() {
  188. const updateManager = uni.getUpdateManager();
  189. updateManager.onCheckForUpdate(function(res) {
  190. // 请求完新版本信息的回调
  191. if (res.hasUpdate) {
  192. updateManager.onUpdateReady(function() {
  193. uni.showModal({
  194. title: '更新提示',
  195. content: '新版本已经准备好,是否重启应用?',
  196. success: function(res) {
  197. if (res.confirm) {
  198. // 新的版本已经下载好,调用 applyUpdate 应用新版本并重启
  199. updateManager.applyUpdate();
  200. }
  201. }
  202. });
  203. });
  204. updateManager.onUpdateFailed(function() {
  205. // 新的版本下载失败
  206. uni.showModal({
  207. title: '已经有新版本了哟~',
  208. content: '新版本已经上线啦~,请您删除当前小程序,重新搜索打开哟~'
  209. });
  210. });
  211. }
  212. });
  213. },
  214. // 确认
  215. adminConfirm() {
  216. uni.clearStorageSync();
  217. uni.redirectTo({
  218. url: '/pages/login/login'
  219. })
  220. },
  221. // 取消
  222. adminCancel() {
  223. uni.switchTab({
  224. url: '/pages/tabBar/home'
  225. })
  226. },
  227. clickCall() {
  228. uni.makePhoneCall({
  229. phoneNumber: this.form.contactNumber,
  230. success: function() {
  231. console.log('拨打电话成功');
  232. },
  233. fail() {
  234. console.log('打电话失败了');
  235. }
  236. })
  237. },
  238. setUp() {
  239. this.$u.route('/pages/user/setUp');
  240. },
  241. clickMeans() {
  242. uni.$u.route('/pages/views/personalInformation/index');
  243. },
  244. clickContacts() {
  245. uni.$u.route('/pages/views/personalInformation/contacts');
  246. },
  247. clickAddress() {
  248. this.$u.route('/pages/views/personalInformation/addressManagement');
  249. },
  250. // 车型
  251. clickVehicle() {
  252. this.$u.route('/pages/tabBar/vehicleModel');
  253. },
  254. // 积分商城
  255. clickPointsMall() {
  256. this.$u.route('/pages/tabBar/pointsMall');
  257. },
  258. clickIntegralOrder() {
  259. this.$u.route('/pages/views/salesSlip/IntegralOrder');
  260. },
  261. // 积分兑换记录
  262. RedemptionOfPoints() {
  263. this.$u.route('/pages/tabBar/integralList/index');
  264. },
  265. // 积分获取记录
  266. obtainRecord() {
  267. this.$u.route('/pages/tabBar/integralList/obtainRecord');
  268. },
  269. // 消费记录
  270. consumptionRecord() {
  271. this.$u.route('/pages/tabBar/integralList/consumptionRecord');
  272. },
  273. pageJump(value) {
  274. uni.$u.route('/pages/views/salesSlip/index', {
  275. text: value
  276. });
  277. },
  278. obligationBtn(value) {
  279. uni.$u.route('/pages/views/salesSlip/obligation', {
  280. text: value
  281. });
  282. },
  283. inIntegralMall() {
  284. uni.$u.route('/pages/integralMall/index');
  285. }
  286. }
  287. }
  288. </script>
  289. <style lang="scss" scoped>
  290. .card {
  291. position: relative;
  292. margin: 0 32rpx;
  293. background-color: #fff;
  294. border-radius: 14rpx;
  295. bottom: 96rpx;
  296. ::v-deep .u-cell__title-text {
  297. font-size: 26rpx;
  298. color: #333333;
  299. }
  300. ::v-deep .u-cell__value {
  301. font-size: 24rpx;
  302. color: #CBCBCB;
  303. }
  304. ::v-deep .u-icon__icon--info {
  305. font-size: 28rpx !important;
  306. color: #CBCBCB;
  307. }
  308. }
  309. .card2 {
  310. position: relative;
  311. margin: 0 32rpx;
  312. background-color: #fff;
  313. border-radius: 14rpx;
  314. bottom: 96rpx;
  315. ::v-deep .u-cell__title-text {
  316. font-size: 24rpx;
  317. font-weight: 400;
  318. color: #797979;
  319. }
  320. }
  321. </style>