index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328
  1. <template>
  2. <view>
  3. <uni-nav-bar title="我的" backgroundColor='#CCEEDB' color="#121816" fixed statusBar @clickRight="inSetting">
  4. <block slot="right">
  5. <view>
  6. <image class="nav-right" src="@/static/images/home/setting.png" />
  7. </view>
  8. </block>
  9. </uni-nav-bar>
  10. <view class="header">
  11. <view style="display: flex;align-items: center;">
  12. <view class="">
  13. <image style="width: 100rpx;height: 100rpx;" src="@/static/images/me/me (1).png" />
  14. </view>
  15. <view style="margin-left: 16rpx;">
  16. <view style="font-size: 30rpx;color: #363F3F;">
  17. {{userData.name||'暂无名称'}}
  18. </view>
  19. <view style="display: flex;align-items: center;font-size: 28rpx;color: #7B7B7B;">
  20. <image style="width: 29rpx;height: 28rpx;" src="@/static/images/me/me (2).png" />
  21. {{userData.address||'暂无地址'}}
  22. </view>
  23. </view>
  24. </view>
  25. <uni-grid :column="4" :showBorder="false" :highlight="false" :square="false" style="margin-top: 40rpx;">
  26. <uni-grid-item v-if="operatingSystem=='android'">
  27. <image style="width: 32rpx;height: 33rpx;" src="@/static/images/me/me (3).png" />
  28. <text style="font-size: 26rpx;line-height: 26rpx;color: #131313;margin-top: 18rpx ;">刘明明</text>
  29. <text style="font-size: 24rpx;line-height: 24rpx;color: #8B8F91;margin-top: 10rpx ;">工厂经理</text>
  30. </uni-grid-item>
  31. <uni-grid-item>
  32. <view @click="allClick('区域查询')" style="display: flex;flex-direction: column;align-items: center;">
  33. <image style="width: 32rpx;height: 33rpx;" src="@/static/images/me/me (4).png" />
  34. <text style="font-size: 26rpx;line-height: 26rpx;color: #131313;margin-top: 18rpx ;">区域查询
  35. </text>
  36. <text style="font-size: 24rpx;line-height: 24rpx;color: #8B8F91;margin-top: 10rpx ;">位置查询</text>
  37. </view>
  38. </uni-grid-item>
  39. <uni-grid-item v-if="operatingSystem=='android'">
  40. <image style="width: 32rpx;height: 33rpx;" src="@/static/images/me/me (5).png" />
  41. <text style="font-size: 26rpx;line-height: 26rpx;color: #131313;margin-top: 18rpx ;">库比森</text>
  42. <text style="font-size: 24rpx;line-height: 24rpx;color: #8B8F91;margin-top: 10rpx ;">签约品牌</text>
  43. </uni-grid-item>
  44. <uni-grid-item v-if="operatingSystem=='android'">
  45. <image style="width: 32rpx;height: 33rpx;" src="@/static/images/me/me (6).png" />
  46. <text style="font-size: 26rpx;line-height: 26rpx;color: #131313;margin-top: 18rpx ;">10万条/年 </text>
  47. <text style="font-size: 24rpx;line-height: 24rpx;color: #8B8F91;margin-top: 10rpx ;">签约任务</text>
  48. </uni-grid-item>
  49. </uni-grid>
  50. </view>
  51. <view v-if="operatingSystem=='android'" style="background: #fff;padding: 40rpx;32rpx 0 32rpx">
  52. <view style="font-size: 28rpx;color: #131313;margin: 0 0 20rpx 30rpx;">
  53. 我的钱包
  54. </view>
  55. <uni-grid :column="4" :showBorder="false" :highlight="false" :square="false">
  56. <uni-grid-item>
  57. <view class="monny-grid">
  58. <text style="font-size: 34rpx;line-height: 34rpx;color: #03803B;margin-top: 30rpx ;">0</text>
  59. <text
  60. style="font-size: 24rpx;line-height: 24rpx;color: #8B8F91;margin:10rpx 0 40rpx 0;">可用返利</text>
  61. </view>
  62. </uni-grid-item>
  63. <uni-grid-item>
  64. <view class="monny-grid">
  65. <text style="font-size: 34rpx;line-height: 34rpx;color: #03803B;margin-top: 30rpx ;">0</text>
  66. <text
  67. style="font-size: 24rpx;line-height: 24rpx;color: #8B8F91;margin:10rpx 0 40rpx 0;">冻结返利</text>
  68. </view>
  69. </uni-grid-item>
  70. <uni-grid-item>
  71. <view class="monny-grid">
  72. <text style="font-size: 34rpx;line-height: 34rpx;color: #03803B;margin-top: 30rpx ;">0</text>
  73. <text
  74. style="font-size: 24rpx;line-height: 24rpx;color: #8B8F91;margin:10rpx 0 40rpx 0;">代金卷</text>
  75. </view>
  76. </uni-grid-item>
  77. <uni-grid-item>
  78. <view class="monny-grid">
  79. <text style="font-size: 34rpx;line-height: 34rpx;color: #03803B;margin-top: 30rpx ;">0</text>
  80. <text
  81. style="font-size: 24rpx;line-height: 24rpx;color: #8B8F91;margin:10rpx 0 40rpx 0;">我的积分</text>
  82. </view>
  83. </uni-grid-item>
  84. </uni-grid>
  85. </view>
  86. <view v-if="operatingSystem=='android'"
  87. style="background: #fff;padding:35rpx 100rpx;margin-top: 30rpx;display: flex;justify-content: space-between;align-items: center;">
  88. <view class="purchase-stock">
  89. <view style="position: absolute;">
  90. <view style="font-size: 51rpx;font-weight: 800;color: #2A2A2A;text-align: center;">
  91. 0 <text style="font-size: 28rpx;">%</text>
  92. </view>
  93. <view style="font-size: 24rpx;color: #8D8D8D;font-weight: 400;">
  94. 销售任务
  95. </view>
  96. </view>
  97. </view>
  98. <view style="display: flex;flex-direction: column;justify-content: space-around;height: 235rpx;">
  99. <view class="">
  100. <view style="font-size: 30rpx;color: #8D8D8D;font-weight: 400;">
  101. 年进货数量
  102. </view>
  103. <view style="font-size: 40rpx;color: #2A2A2A;font-weight: bold;">
  104. 0 <text style="font-size: 28rpx;color: #8D8D8D;font-weight: 400;margin-left: 10rpx;">条</text>
  105. </view>
  106. </view>
  107. <view class="">
  108. <view style="font-size: 30rpx;color: #8D8D8D;font-weight: 400;">
  109. 本月进货数量
  110. </view>
  111. <view style="font-size: 40rpx;color: #2A2A2A;font-weight: bold;">
  112. 0 <text style="font-size: 28rpx;color: #8D8D8D;font-weight: 400;margin-left: 10rpx;">条</text>
  113. </view>
  114. </view>
  115. </view>
  116. </view>
  117. <view v-if="operatingSystem=='android'" style="background: #fff;padding: 40rpx;32rpx 0 32rpx;margin-top: 30rpx;">
  118. <uni-grid :column="5" :showBorder="false" :highlight="false" :square="false">
  119. <uni-grid-item>
  120. <view @click="allClick('门店订单')">
  121. <view class="monny-grid2">
  122. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (8).png" />
  123. </view>
  124. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">门店订单</text>
  125. </view>
  126. </uni-grid-item>
  127. <uni-grid-item>
  128. <view @click="allClick('出库任务')">
  129. <view class="monny-grid2">
  130. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (9).png" />
  131. </view>
  132. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">出库任务</text>
  133. </view>
  134. </uni-grid-item>
  135. <uni-grid-item>
  136. <view @click="allClick('出库列表')">
  137. <view class="monny-grid2">
  138. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (10).png" />
  139. </view>
  140. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">出库列表</text>
  141. </view>
  142. </uni-grid-item>
  143. <uni-grid-item>
  144. <view @click="allClick('待审客户')">
  145. <view class="monny-grid2">
  146. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (11).png" />
  147. </view>
  148. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">待审客户</text>
  149. </view>
  150. </uni-grid-item>
  151. <uni-grid-item>
  152. <view @click="allClick('订单审批')">
  153. <view class="monny-grid2">
  154. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (12).png" />
  155. </view>
  156. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">订单审批</text>
  157. </view>
  158. </uni-grid-item>
  159. <uni-grid-item>
  160. <view @click="allClick('客户分析')">
  161. <view class="monny-grid2">
  162. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (13).png" />
  163. </view>
  164. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">客户分析</text>
  165. </view>
  166. </uni-grid-item>
  167. <uni-grid-item>
  168. <view @click="allClick('销售开单')">
  169. <view class="monny-grid2">
  170. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (14).png" />
  171. </view>
  172. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">销售开单</text>
  173. </view>
  174. </uni-grid-item>
  175. <uni-grid-item>
  176. <view @click="allClick('库存查询')">
  177. <view class="monny-grid2">
  178. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (15).png" />
  179. </view>
  180. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">库存查询</text>
  181. </view>
  182. </uni-grid-item>
  183. <uni-grid-item>
  184. <view @click="allClick('客户信息')">
  185. <view class="monny-grid2">
  186. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (16).png" />
  187. </view>
  188. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">客户信息</text>
  189. </view>
  190. </uni-grid-item>
  191. <uni-grid-item>
  192. <view @click="allClick('功能名称')">
  193. <view class="monny-grid2">
  194. <image style="width: 41rpx;height: 41rpx;" src="@/static/images/me/me (17).png" />
  195. </view>
  196. <text style="font-size: 26rpx;#color: #2A2A2A;font-weight: 400;">功能名称</text>
  197. </view>
  198. </uni-grid-item>
  199. </uni-grid>
  200. </view>
  201. </view>
  202. </template>
  203. <script>
  204. import {
  205. getAppUser,
  206. submit
  207. } from '@/api/me/index.js'
  208. export default {
  209. data() {
  210. return {
  211. userData: {},
  212. operatingSystem:'android'
  213. }
  214. },
  215. onLoad() {
  216. this.getAppUser()
  217. this.operatingSystem = uni.getSystemInfoSync().platform;
  218. },
  219. onShow() {
  220. uni.$on('sendAmap', (data) => {
  221. this.userData.longitude = data.location ? data.location.split(',')[0] : null
  222. this.userData.dimension = data.location ? data.location.split(',')[1] : null
  223. this.submit()
  224. });
  225. },
  226. onUnload() {
  227. uni.$off();
  228. },
  229. methods: {
  230. getAppUser() {
  231. getAppUser().then(res => {
  232. this.userData = res.data
  233. })
  234. .finally(() => {
  235. uni.hideLoading()
  236. });
  237. },
  238. submit() {
  239. submit(this.userData).then(res => {
  240. this.getAppUser()
  241. })
  242. },
  243. allClick(name) {
  244. if (name == '区域查询') {
  245. if (this.userData.longitude && this.userData.dimension) {
  246. console.log(this.userData.longitude, this.userData.dimension)
  247. uni.navigateTo({
  248. url: `/pages/me/map/index?longitude=${this.userData.longitude}&latitude=${this.userData.dimension}`
  249. });
  250. } else {
  251. uni.navigateTo({
  252. url: `/pages/me/map/index`
  253. });
  254. }
  255. } else {
  256. uni.showToast({
  257. title: "开发中",
  258. icon: "none",
  259. });
  260. }
  261. },
  262. inSetting() {
  263. uni.navigateTo({
  264. url: '/pages/me/setting/index'
  265. });
  266. },
  267. }
  268. }
  269. </script>
  270. <style lang="scss" scoped>
  271. ::v-deep .uni-navbar--border {
  272. border-bottom: none !important;
  273. }
  274. ::v-deep .uni-grid-item__box {
  275. align-items: center !important;
  276. }
  277. .nav-right {
  278. width: 32rpx;
  279. height: 30rpx;
  280. }
  281. .header {
  282. background: linear-gradient(180deg, #CCEEDB, #F3F8F6);
  283. padding: 60rpx;
  284. }
  285. .monny-grid {
  286. background: linear-gradient(180deg, #F0FFF7, #FCFFFD);
  287. display: flex;
  288. flex-direction: column;
  289. align-items: center;
  290. width: 149rpx;
  291. }
  292. .monny-grid2 {
  293. background: linear-gradient(180deg, #F0FFF7, #FCFFFD);
  294. display: flex;
  295. flex-direction: column;
  296. align-items: center;
  297. justify-content: center;
  298. width: 100rpx;
  299. height: 85rpx;
  300. }
  301. .purchase-stock {
  302. background: url('@/static/images/me/me (7).png');
  303. background-size: 100% 100%;
  304. width: 245rpx;
  305. height: 235rpx;
  306. display: flex;
  307. justify-content: center;
  308. align-items: center;
  309. }
  310. </style>