猫妈狗爸伴宠师小程序前端代码
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

480 lines
9.6 KiB

3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
3 months ago
  1. <template>
  2. <view>
  3. <view class="containers po-r">
  4. <image src="" mode="" class="mainBg"></image>
  5. <view class="w-100 po-a content">
  6. <stepProgress :step="3"></stepProgress>
  7. <view class="step mt24">
  8. <view class="li flex-rowl">
  9. <view class="num flex-rowc">
  10. 1
  11. </view>
  12. <view class="item">
  13. <view class="flex-between mb10">
  14. <view class="flex-rowl">
  15. <image class="img" src="@/static/images/ydd/end12.png" mode=""></image>
  16. <text class="size-30 color-000 fw700">实名认证</text>
  17. </view>
  18. <view class="size-22 color-ffb">
  19. 已完成
  20. </view>
  21. </view>
  22. <view class="info">
  23. <!-- todo: 实名认证 -->
  24. <view class="size-22 color-777">
  25. {{ `真实姓名:${form.name}` }}
  26. </view>
  27. <view class="size-22 color-777">
  28. {{ `身份证号码:${form.idCard}` }}
  29. </view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class="li flex-rowl po-r">
  34. <view class="line po-a">
  35. </view>
  36. <view class="num flex-rowc">
  37. 2
  38. </view>
  39. <view class="item">
  40. <view class="flex-between mb10">
  41. <view class="flex-rowl">
  42. <image class="img" src="@/static/images/ydd/end13.png" mode="widthFix"></image>
  43. <text class="size-30 color-000 fw700">履约保证金缴纳</text>
  44. </view>
  45. <view class="size-22 color-ffb jiao" @click="jumpToBond">
  46. 去缴纳
  47. </view>
  48. <!-- todo -->
  49. <!-- <view class="size-22 highlight">
  50. 已完成
  51. </view> -->
  52. </view>
  53. <view class="info color-777 size-22">
  54. 请缴纳履约保证金保证金注销时可申请退还
  55. </view>
  56. </view>
  57. </view>
  58. <view class="li flex-rowl po-r">
  59. <view class="line po-a" style="height: 150rpx;">
  60. </view>
  61. <view class="num flex-rowc">
  62. 3
  63. </view>
  64. <view class="item">
  65. <view class="flex-between mb10">
  66. <view class="flex-rowl">
  67. <image class="img" src="@/static/images/ydd/end1(4).png" mode="widthFix"></image>
  68. <text class="size-30 color-000 fw700">添加客服微信</text>
  69. </view>
  70. <view class="size-22 highlight">
  71. 请自行添加
  72. </view>
  73. </view>
  74. <view class="info color-777 size-22 flex-rowl">
  75. <text class="size-22 color-777">微信二维码</text>
  76. <image :src="configList.wx_image.paramValueImage" mode="widthFix"
  77. style="width: 150rpx;height: 150rpx;"></image>
  78. </view>
  79. </view>
  80. </view>
  81. <view class="li flex-rowl po-r">
  82. <view class="line po-a" style="height: 150rpx;">
  83. </view>
  84. <view class="num flex-rowc">
  85. 4
  86. </view>
  87. <view class="item">
  88. <view class="flex-between mb10">
  89. <view class="flex-rowl">
  90. <image class="img" src="@/static/images/ydd/end13.png" mode="widthFix"></image>
  91. <text class="size-30 color-000 fw700">服务工具准备</text>
  92. </view>
  93. <view class="size-22 flex-rowr" @click="openToolsInfoModal">
  94. <text>查看工具包</text>
  95. <up-icon name="arrow-down" color="#7F7F7F" size="17rpx"
  96. style="margin-left: 5rpx;"></up-icon>
  97. </view>
  98. </view>
  99. <!-- <view class="info color-777 size-22">
  100. <view class="flex-between">
  101. <text class="size-22">所在地区:</text>
  102. <view plain class="flex-rowr" @click="selectAddr">
  103. <text>{{ form.area ? form.area : '请选择' }}</text>
  104. <up-icon style="margin-left: 22rpx;" name="arrow-down" color="#7F7F7F"
  105. size="21rpx"></up-icon>
  106. </view>
  107. </view>
  108. </view> -->
  109. <view class="info color-777 size-22 mt20">
  110. <view class="flex-between">
  111. <text class="size-22">姓名:</text>
  112. <input v-model="form.name" type="text" placeholder="请输入姓名" />
  113. </view>
  114. </view>
  115. <view class="info color-777 size-22 mt20">
  116. <view class="flex-between">
  117. <text class="size-22">电话:</text>
  118. <input v-model="form.phone" type="text" placeholder="请输入道路、小区、门牌号等" />
  119. </view>
  120. </view>
  121. <view class="info color-777 size-22 mt20">
  122. <view class="flex-between">
  123. <text class="size-22">地址:</text>
  124. <input v-model="form.address" type="text" placeholder="请输入收货地址" />
  125. </view>
  126. </view>
  127. </view>
  128. </view>
  129. </view>
  130. <view class="footer-btn" @click="onSave">
  131. <view class="btn">
  132. 提交审核
  133. </view>
  134. </view>
  135. </view>
  136. <up-modal :show="showToolsInfoModal" :showConfirmButton="false" :showCancelButton="false"
  137. :closeOnClickOverlay="true" @close="closeToolsInfoModal">
  138. <up-parse class="size-28" :content="configList.pet_tools.paramValueArea"></up-parse>
  139. </up-modal>
  140. </view>
  141. <button plain class="chat" open-type="contact">
  142. <image src="@/static/images/ydd/chat.png" mode="widthFix"></image>
  143. </button>
  144. </view>
  145. </template>
  146. <script setup>
  147. import {
  148. ref,
  149. reactive,
  150. computed
  151. } from "vue";
  152. import {
  153. onShow
  154. } from '@dcloudio/uni-app'
  155. import {
  156. useStore
  157. } from 'vuex'
  158. import {
  159. udpateUser,
  160. getUserOne
  161. } from '@/api/userTeacher'
  162. import stepProgress from '../components/stepProgress.vue';
  163. const store = useStore()
  164. const configList = computed(() => {
  165. return store.getters.configList
  166. })
  167. const userId = computed(() => {
  168. return store.state.user.userInfo.userId
  169. })
  170. const id = ref()
  171. const form = reactive({
  172. name: null,
  173. idCard: null,
  174. area: null,
  175. latitude: null,
  176. longitude: null,
  177. address: null,
  178. })
  179. const initData = async () => {
  180. console.log('--initData')
  181. try {
  182. const data = await getUserOne(userId.value)
  183. const {
  184. id: _id,
  185. name,
  186. idCard,
  187. } = data
  188. id.value = _id
  189. form.name = name
  190. form.idCard = idCard
  191. } catch (err) {
  192. console.log('--err', err)
  193. }
  194. }
  195. onShow(() => {
  196. initData()
  197. })
  198. const jumpToBond = () => {
  199. uni.navigateTo({
  200. url: "/otherPages/myOrdersManage/bond/index"
  201. })
  202. }
  203. const showToolsInfoModal = ref(false)
  204. const openToolsInfoModal = () => {
  205. showToolsInfoModal.value = true
  206. }
  207. const closeToolsInfoModal = () => {
  208. showToolsInfoModal.value = false
  209. }
  210. const setAddress = (res) => {
  211. //经纬度信息
  212. form.latitude = res.latitude
  213. form.longitude = res.longitude
  214. if (!res.address && res.name) { //用户直接选择城市的逻辑
  215. return form.area = res.name
  216. }
  217. if (res.address || res.name) {
  218. return form.area = res.address + res.name
  219. }
  220. form.area = '' //用户啥都没选就点击勾选
  221. }
  222. const selectAddr = () => {
  223. uni.chooseLocation({
  224. success: function(res) {
  225. setAddress(res)
  226. }
  227. })
  228. }
  229. const onSave = async () => {
  230. try {
  231. const {
  232. area,
  233. latitude,
  234. longitude,
  235. address,
  236. name,
  237. phone,
  238. } = form
  239. const data = {
  240. id: id.value,
  241. area,
  242. latitude,
  243. longitude,
  244. address,
  245. name,
  246. phone,
  247. }
  248. await udpateUser(data)
  249. uni.showToast({
  250. title: '提交成功!',
  251. icon: "none"
  252. })
  253. setTimeout(() => {
  254. uni.reLaunch({
  255. url: "/pages/workbenchManage/index"
  256. })
  257. }, 1000)
  258. } catch (err) {
  259. }
  260. }
  261. </script>
  262. <style lang="scss" scoped>
  263. .chat {
  264. position: fixed;
  265. right: 20rpx;
  266. bottom: 400rpx;
  267. z-index: 9999;
  268. border: none;
  269. padding: 0;
  270. width: 97rpx;
  271. height: auto;
  272. image {
  273. width: 100%;
  274. }
  275. }
  276. .line {
  277. width: 3rpx;
  278. height: 100rpx;
  279. background-color: #BDBDBD;
  280. left: 25rpx;
  281. top: -50rpx;
  282. }
  283. .jiao {
  284. padding: 5px 20rpx;
  285. border-radius: 30rpx;
  286. background-color: #FFBF60;
  287. color: #fff;
  288. }
  289. .li {
  290. width: 710rpx;
  291. .num {
  292. width: 50rpx;
  293. height: 50rpx;
  294. border-radius: 50%;
  295. background-color: #FFBF60;
  296. color: #fff;
  297. font-weight: 700;
  298. font-size: 26rpx;
  299. margin-right: 20rpx;
  300. }
  301. }
  302. .item {
  303. padding: 26rpx 36rpx;
  304. border-radius: 24rpx;
  305. background-color: #fff;
  306. margin-bottom: 24rpx;
  307. width: 590rpx;
  308. .info {
  309. padding: 16rpx;
  310. background-color: #f3f3f3;
  311. border-radius: 16rpx;
  312. }
  313. }
  314. .img {
  315. width: 40rpx;
  316. height: 40rpx;
  317. margin-right: 8rpx;
  318. }
  319. .bt120 {
  320. margin-bottom: 120rpx;
  321. width: 716rpx;
  322. box-sizing: border-box;
  323. }
  324. .footer-btn {
  325. z-index: 9999;
  326. width: 100vw;
  327. height: 144rpx;
  328. background-color: #fff;
  329. display: flex;
  330. justify-content: center;
  331. position: fixed;
  332. bottom: 0;
  333. left: 0;
  334. align-items: center;
  335. .btn {
  336. font-size: 30rpx;
  337. color: #fff;
  338. display: flex;
  339. justify-content: center;
  340. align-items: center;
  341. width: 574rpx;
  342. height: 94rpx;
  343. border-radius: 94rpx;
  344. background-color: #FFBF60;
  345. }
  346. }
  347. .type {
  348. width: 190rpx;
  349. margin-bottom: 74rpx;
  350. }
  351. .form {
  352. padding: 40rpx 32rpx;
  353. box-sizing: border-box;
  354. width: 716rpx;
  355. }
  356. .title {
  357. &::before {
  358. content: "";
  359. display: block;
  360. width: 9rpx;
  361. height: 33rpx;
  362. background-color: #FFBF60;
  363. margin-right: 7rpx;
  364. }
  365. }
  366. .mb6 {
  367. margin-bottom: 6rpx;
  368. }
  369. .containers {
  370. .neir {
  371. padding: 47rpx 27rpx 36rpx 27rpx;
  372. border-radius: 16rpx;
  373. box-sizing: border-box;
  374. width: 716rpx;
  375. .steps {
  376. .line {
  377. width: 163rpx;
  378. height: 3rpx;
  379. background-color: #BDBDBD;
  380. margin-bottom: 30rpx;
  381. }
  382. .num {
  383. width: 50rpx;
  384. height: 50rpx;
  385. background-color: #FFBF60;
  386. border-radius: 50%;
  387. }
  388. }
  389. }
  390. .mainBg {
  391. width: 100vw;
  392. height: 442rpx;
  393. background-image: linear-gradient(to bottom, #FFBF60, #f5f5f5);
  394. }
  395. .content {
  396. top: 0;
  397. left: 0;
  398. padding: 16rpx;
  399. padding-bottom: 200rpx;
  400. .logo {
  401. width: 194rpx;
  402. height: 70rpx;
  403. }
  404. .renz {
  405. image {
  406. width: 26rpx;
  407. height: 26rpx;
  408. }
  409. }
  410. }
  411. }
  412. .highlight {
  413. color: #FFBF60;
  414. }
  415. </style>