index.vue 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386
  1. <template>
  2. <view class="myContent">
  3. <!-- <image class="myBg" :src="imgObj.myBg" mode="scaleToFill" /> -->
  4. <view class="topTitle" :style="{ marginTop: navTop + 'rpx' }"
  5. >个人中心</view
  6. >
  7. <view class="userBox" :style="{ marginTop: navTop + 125 + 'rpx' }">
  8. <image class="avatar" :src="imgObj.user" mode="scaleToFill" />
  9. <view class="nickName">
  10. <text class="name">{{ phone || mobile || "用户昵称" }}</text>
  11. <text v-if="!phone && !mobile" class="login" @click="onLogin"
  12. >点击登录</text
  13. >
  14. </view>
  15. </view>
  16. <view class="dataBox" :style="{ marginTop: navTop + 290 + 'rpx' }">
  17. <view class="dataItem" v-for="(item, index) in list" :key="index">
  18. <view class="inside">
  19. <text class="label">{{ item.label }}</text
  20. ><br />
  21. <text>0</text>
  22. </view>
  23. <image :src="item.src" mode="scaleToFill" />
  24. </view>
  25. </view>
  26. <view class="content">
  27. <!-- <view style="margin: 26rpx 32rpx 0">
  28. <nearly-store-box></nearly-store-box>
  29. </view> -->
  30. <view class="toolBox">
  31. <view class="title"> 常用工具 </view>
  32. <view class="tools">
  33. <wd-cell is-link title="奖励记录" @click="toWinner">
  34. <template #icon>
  35. <image :src="imgObj.gift" mode="scaleToFill" />
  36. </template>
  37. <image
  38. style="width: 128rpx; height: 48rpx"
  39. :src="imgObj.with"
  40. mode="scaleToFill"
  41. class="custom-text"
  42. />
  43. </wd-cell>
  44. <wd-cell border is-link title="上传记录" @click="toUpLoad">
  45. <template #icon>
  46. <image :src="imgObj.page" mode="scaleToFill" />
  47. </template>
  48. </wd-cell>
  49. </view>
  50. </view>
  51. <!-- <view class="addressBox">
  52. <view class="title"> 附近门店 </view>
  53. <view>
  54. <view v-for="(item, index) in list2" :key="index" class="address">
  55. <view class="left">
  56. <text class="a">{{ item.title }}</text>
  57. <text class="b">{{ item.label }}</text>
  58. <text class="c">{{ item.content }}</text>
  59. </view>
  60. <image
  61. @click="toLink(item)"
  62. src="https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/loca.png"
  63. mode="scaleToFill"
  64. />
  65. </view>
  66. </view>
  67. </view> -->
  68. </view>
  69. <user-login-popup
  70. ref="loginRef"
  71. :path="path"
  72. @getPhone="getPhone"
  73. ></user-login-popup>
  74. </view>
  75. </template>
  76. <script setup lang="ts">
  77. import { onLoad, onShow } from "@dcloudio/uni-app";
  78. import { ref } from "vue";
  79. import { getNavTop } from "@/utils/system";
  80. import { paymentAPI } from "@/services/ams";
  81. import { getActivityData, isGetPhone, getMobile } from "@/utils/system";
  82. import UserLoginPopup from "@/components/userLoginPopup.vue";
  83. import NearlyStoreBox from "./components/nearlyStoreBox.vue";
  84. const imgObj = {
  85. user: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/user.png",
  86. int: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/int.png",
  87. coupon: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/coupon.png",
  88. gift: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/gift.png",
  89. page: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/page.png",
  90. with: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/with.png",
  91. myBg: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/myBg.png",
  92. };
  93. const list = [
  94. {
  95. label: "可用积分",
  96. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/int.png",
  97. num: 0,
  98. },
  99. {
  100. label: "优惠券",
  101. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/coupon.png",
  102. num: 0,
  103. },
  104. ];
  105. const list2 = [
  106. {
  107. title: "连先生便利店",
  108. label: "距离您88m",
  109. content: "麓枫和苑6栋一单元",
  110. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/address1.png",
  111. },
  112. {
  113. title: "转角手作町",
  114. label: "距离您126m",
  115. content: "后湖创业园内",
  116. src: "https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/address2.png",
  117. },
  118. ];
  119. const navTop = ref<number>(0);
  120. const loginRef = <any>ref(null);
  121. const path = ref<string>("");
  122. const phone = uni.getStorageSync("phone");
  123. const toWinner = () => {
  124. path.value = "/pagesOne/record/winnerList";
  125. if (!isGetPhone()) {
  126. loginRef.value.show = true;
  127. } else {
  128. uni.navigateTo({
  129. url: "/pagesOne/record/winnerList",
  130. });
  131. }
  132. };
  133. const toUpLoad = () => {
  134. path.value = "/pagesOne/record/uploadList";
  135. if (!isGetPhone()) {
  136. loginRef.value.show = true;
  137. } else {
  138. uni.navigateTo({
  139. url: "/pagesOne/record/uploadList",
  140. });
  141. }
  142. };
  143. const mobile = ref<string>("");
  144. const onLogin = async (e: any) => {
  145. path.value = "";
  146. if (!isGetPhone()) {
  147. loginRef.value.show = true;
  148. }
  149. };
  150. const getPhone = (res: string) => {
  151. mobile.value = res;
  152. };
  153. const toLink = (data: any) => {
  154. uni.navigateTo({
  155. url:
  156. "/pages/my/location" +
  157. `?title=${data.title}&label=${data.label}&content=${data.content}&src=${data.src}`,
  158. });
  159. };
  160. onLoad(() => {
  161. navTop.value = getNavTop();
  162. });
  163. onShow(() => {
  164. getActivityData();
  165. });
  166. // const onLogin = async () => {
  167. // let form = {
  168. // mobile: "18927563000",
  169. // password: "123456",
  170. // };
  171. // let res: any = await postLoginAPI(form);
  172. // if (res.code == 200) {
  173. // } else {
  174. // return uni.showToast({
  175. // title: res.msg,
  176. // icon: "none",
  177. // });
  178. // }
  179. // };
  180. </script>
  181. <style lang="scss" scoped>
  182. .myContent {
  183. font-family: PingFang SC;
  184. width: 100%;
  185. min-height: 100vh;
  186. background: url("https://qiuyu-daodian.oss-cn-beijing.aliyuncs.com/images/myBg.png")
  187. no-repeat top center;
  188. background-size: 100% 452rpx;
  189. // no-repeat center center / 100% 100%;
  190. overflow: hidden;
  191. // position: relative;
  192. // .myBg {
  193. // width: 100%;
  194. // height: 450rpx;
  195. // // position: absolute;
  196. // // top: 0;
  197. // // z-index: -1;
  198. // }
  199. view {
  200. box-sizing: border-box;
  201. }
  202. .content {
  203. background: #f7f8f9;
  204. width: 100%;
  205. height: 100vh;
  206. overflow: hidden;
  207. // margin-top: -150rpx;
  208. // position: relative;
  209. // z-index: -1;
  210. }
  211. .topTitle {
  212. color: #fff;
  213. font-size: 32rpx;
  214. font-weight: 500;
  215. width: 100%;
  216. height: 80rpx;
  217. line-height: 80rpx;
  218. text-align: center;
  219. position: fixed;
  220. top: 0;
  221. left: 0;
  222. }
  223. .userBox {
  224. padding: 0 50rpx;
  225. display: flex;
  226. color: #fff;
  227. align-items: center;
  228. position: absolute;
  229. top: 0;
  230. .avatar {
  231. width: 120rpx;
  232. height: 120rpx;
  233. margin-right: 32rpx;
  234. }
  235. .nickName {
  236. display: flex;
  237. flex-direction: column;
  238. justify-content: flex-start;
  239. font-size: 28rpx;
  240. }
  241. .name {
  242. font-weight: 500;
  243. font-size: 36rpx;
  244. margin-bottom: 20rpx;
  245. }
  246. }
  247. .dataBox {
  248. // margin: 64rpx 32rpx 26rpx;
  249. height: 192rpx;
  250. padding: 0 24rpx;
  251. border-radius: 24rpx;
  252. background: linear-gradient(
  253. 90deg,
  254. #ffd67a 0%,
  255. #ffedb0 45.92%,
  256. #fec669 100%
  257. );
  258. display: flex;
  259. justify-content: space-between;
  260. align-items: center;
  261. margin: auto 32rpx;
  262. // position: absolute;
  263. // left: 32rpx;
  264. // right: 32rpx;
  265. .dataItem {
  266. height: 144rpx;
  267. width: 49%;
  268. display: flex;
  269. justify-content: space-between;
  270. background: linear-gradient(180deg, #e5fff6 0%, #ffffff 100%);
  271. border-radius: 24rpx;
  272. padding: 26rpx 32rpx;
  273. color: #296041;
  274. font-size: 24rpx;
  275. font-weight: 500;
  276. .label {
  277. font-size: 32rpx;
  278. margin-bottom: 8rpx;
  279. }
  280. image {
  281. width: 92rpx;
  282. height: 92rpx;
  283. }
  284. }
  285. }
  286. .title {
  287. color: #000;
  288. font-weight: bold;
  289. font-size: 28rpx;
  290. padding: 24rpx 0 22rpx 24rpx;
  291. }
  292. .toolBox {
  293. margin: 26rpx 32rpx 0;
  294. background: #fff;
  295. border-radius: 16rpx;
  296. background: #fff;
  297. position: relative;
  298. image {
  299. height: 48rpx;
  300. width: 48rpx;
  301. margin-right: 24rpx;
  302. }
  303. ::v-deep .wd-cell__wrapper {
  304. display: flex;
  305. align-items: center;
  306. }
  307. ::v-deep .wd-cell__value {
  308. display: flex;
  309. align-items: center;
  310. justify-content: flex-end;
  311. }
  312. ::v-deep .wd-icon-arrow-right {
  313. margin-left: 0;
  314. }
  315. ::v-deep .wd-cell__title {
  316. color: #666;
  317. font-size: 28rpx;
  318. }
  319. .custom-text {
  320. // border: 2rpx solid;
  321. // margin-top: 5rpx;
  322. }
  323. }
  324. .addressBox {
  325. margin: 26rpx 32rpx 0;
  326. background: #fff;
  327. padding: 26rpx 32rpx;
  328. border-radius: 24rpx;
  329. .title {
  330. padding: 0;
  331. margin-bottom: 32rpx;
  332. }
  333. .address {
  334. display: flex;
  335. justify-content: space-between;
  336. align-items: center;
  337. padding-bottom: 16rpx;
  338. margin-bottom: 16rpx;
  339. border-bottom: 2rpx solid #bfc8db80;
  340. &:last-child {
  341. border: none;
  342. }
  343. }
  344. .left {
  345. color: #666;
  346. font-weight: bold;
  347. font-size: 28rpx;
  348. > text {
  349. display: block;
  350. }
  351. .a {
  352. color: #337b52;
  353. }
  354. .b {
  355. color: #666;
  356. }
  357. .c {
  358. font-size: 24rpx;
  359. font-weight: normal;
  360. }
  361. }
  362. image {
  363. width: 84rpx;
  364. height: 90rpx;
  365. }
  366. }
  367. }
  368. </style>