mylocation.vue 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476
  1. <template>
  2. <view style="position: relative;">
  3. <!-- 胶囊 -->
  4. <mvBar :mysNavConfig="mysNavConfig"></mvBar>
  5. <view style="height: 180rpx;width: 100%; position: fixed;background-color: #FFFFFF;top: 0;z-index: 8;">
  6. </view>
  7. <view class="menu">
  8. <view class="menu-item" @click="topersoninfo()">
  9. <p>个人资料</p>
  10. </view>
  11. <view class="menu-item">
  12. <p class='lor'>收货地址</p>
  13. </view>
  14. <view class="menu-item" @click="tomyaccount()">
  15. <p>社媒账号</p>
  16. </view>
  17. <view class="menu-item" @click="tomybank()">
  18. <p>提现绑定</p>
  19. </view>
  20. </view>
  21. <view style="padding-top: 260rpx;width: 97%;">
  22. <!-- 收货地址 -->
  23. <view class="card" style="margin-top: 6%;" v-for="item in list">
  24. <view class="">
  25. <view class="" style="display: flex;justify-content:space-around;align-items: center;">
  26. <view class="">
  27. <image class="head-img" :src="picture.icon_loc" mode="">
  28. </image>
  29. </view>
  30. <view class="" style="padding-left: 3%;padding-right: 3%;width: 80%;">
  31. <view style="display: flex;">
  32. <p class='ipon' style="padding-right: 200rpx;">{{item.receiver_name}}</p>
  33. <p class='ipon'>{{item.phone_number}}</p>
  34. </view>
  35. <p class='ipon'>{{item.detail_addr}}</p>
  36. </view>
  37. </view>
  38. <view class="" style="border-bottom: 2rpx solid #C0C0C0;margin-top: 3%;margin-bottom: 3%;"> </view>
  39. <view class="" style="display: flex;justify-content:space-between ;">
  40. <view class="Tasktext">
  41. <label>
  42. <radio color="#F0D232" :value="item.default_tag" :checked="item.default_tag" style="transform:scale(0.7);
  43. font-size: 30rpx;" @click="setdefault(item)" name="radio" />
  44. 默认地址
  45. </label>
  46. </view>
  47. <view class="func">
  48. <view class="func-btn" @click="edit(item)">
  49. <image :src="picture.icon_edit" mode="">
  50. </image>
  51. <span>编辑</span>
  52. </view>
  53. <view class="func-btn" @click="del(item)">
  54. <image :src="picture.icon_del" mode="" style="width: 33rpx;height: 33rpx;">
  55. </image>
  56. <span>删除</span>
  57. </view>
  58. </view>
  59. </view>
  60. </view>
  61. </view>
  62. </view>
  63. <view class="" style="width: 100%;height: 150rpx;">
  64. </view>
  65. <view class="signup">
  66. <view class="signupbtn">
  67. <button type="default" class="manu-btn" @click="addreceipt()">手动添加</button>
  68. </view>
  69. <view class="signupbtn">
  70. <button type="default" class="auto-btn" @click="chooseAddr()">
  71. <image class="weixinlogo" :src="weixinimage">
  72. </image>
  73. <p class="auto-text">
  74. 自动获取</p>
  75. </button>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. import mvBar from "@/components/mys_navBar/mysNavBar";
  82. export default {
  83. components: {
  84. mvBar,
  85. },
  86. data() {
  87. return {
  88. weixinimage: "../../static/img/icon-weixin.png",
  89. picture: {
  90. icon_edit:'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-edit.png',
  91. icon_del:'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-del.png',
  92. icon_loc:'https://horastar.obs.cn-east-3.myhuaweicloud.com/youngee/talent_upload/icon-loc.png',
  93. home8: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home8.png',
  94. home10: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home10.png',
  95. home11: 'https://horastar.obs.cn-east-3.myhuaweicloud.com/talent/home11.png',
  96. },
  97. list: [],
  98. mysNavConfig: {
  99. /* 开启单页显示首页图标 */
  100. isHome: true,
  101. /* 固定导航 */
  102. navFixed: true,
  103. /* 标题 (屏幕中心居中 两边图标中心居中使用slot center1) */
  104. navTitle: {
  105. text: "我的信息",
  106. color: "",
  107. fontSize: "32rpx", // px upx rpx
  108. fontWeight: "normal", // 100 - 700
  109. },
  110. btnType: "type2",
  111. onLeftClick: "/pages/mycenter/mycenter",
  112. /* type2 按钮 */
  113. type2Config: {
  114. // 左图标
  115. leftPath: "/static/img/png2.png",
  116. // 右图标
  117. rightPath: "/static/img/png4.png",
  118. // 圆角
  119. radius: "40rpx",
  120. },
  121. },
  122. };
  123. },
  124. onShow() {
  125. this.getlist()
  126. },
  127. onLoad() {
  128. },
  129. methods: {
  130. tomybank() {
  131. uni.navigateTo({
  132. url: './mybank'
  133. });
  134. },
  135. topersoninfo() {
  136. uni.navigateTo({
  137. url: './personinfo'
  138. });
  139. },
  140. tomyaccount() {
  141. uni.navigateTo({
  142. url: './myaccount'
  143. });
  144. },
  145. // 列表
  146. getlist() {
  147. this.$https.get('/youngee/c/t/g/get-talent-address')
  148. .then(res => {
  149. console.log(res)
  150. this.list = res.data.data
  151. if (this.list.length == 0)
  152. uni.navigateTo({
  153. url: '/pages/mycenter/addlocation?ismodify=0'
  154. });
  155. })
  156. },
  157. // 进入添加收货地址
  158. addreceipt() {
  159. uni.navigateTo({
  160. url: '/pages/mycenter/addlocation?ismodify=0'
  161. });
  162. },
  163. chooseAddr() {
  164. const that = this
  165. uni.chooseAddress({
  166. success(res) {
  167. console.log(res)
  168. console.log(res.userName)
  169. console.log(res.postalCode)
  170. console.log(res.provinceName)
  171. console.log(res.cityName)
  172. console.log(res.countyName)
  173. console.log(res.detailInfo)
  174. console.log(res.nationalCode)
  175. console.log(res.telNumber)
  176. that.$https.post('/youngee/c/t/p/add-talent-address', {
  177. region_code: res.nationalCode,
  178. detail_addr: res.provinceName + res.cityName + res.countyName + res.detailInfo,
  179. phone_number: res.telNumber,
  180. receiver_name: res.userName,
  181. mail_code: res.postalCode,
  182. default_tag: 1
  183. })
  184. .then(res => {
  185. console.log(res)
  186. that.getlist()
  187. })
  188. }
  189. })
  190. },
  191. // 改变默认地址
  192. setdefault(item) {
  193. console.log(item.default_tag)
  194. if (item.default_tag === 1)
  195. return
  196. this.$https.post('/youngee/c/t/p/change-default-delivery-addr', {
  197. address_id: item.address_id,
  198. })
  199. .then(res => {
  200. console.log(res)
  201. this.getlist()
  202. uni.showToast({
  203. title: '修改成功'
  204. })
  205. })
  206. // var that = this;
  207. // uni.showModal({
  208. // title: '提示',
  209. // content: '确认修改默认地址',
  210. // success: function(res) {
  211. // if (res.confirm) {
  212. // that.$https.post('/youngee/c/t/p/change-default-delivery-addr', {
  213. // address_id: item.address_id,
  214. // })
  215. // .then(res => {
  216. // console.log(res)
  217. // that.getlist()
  218. // uni.showToast({
  219. // title: '修改成功'
  220. // })
  221. // })
  222. // } else if (res.cancel) {
  223. // console.log('用户点击取消');
  224. // }
  225. // },
  226. // })
  227. },
  228. // 编辑地址
  229. edit(item) {
  230. console.log(item.receiver_name)
  231. uni.navigateTo({
  232. url: '/pages/mycenter/addlocation?address_id=' + item.address_id + '&ismodify=1'
  233. });
  234. },
  235. // 删除地址
  236. del(item) {
  237. let that = this
  238. uni.showModal({
  239. title: '提示',
  240. content: '确认删除',
  241. success: function(res) {
  242. if (res.confirm) {
  243. // console.log(item)
  244. that.$https.post('/youngee/c/t/p/delete-talent-address', {
  245. address_id: item.address_id,
  246. default_tag: item.default_tag,
  247. })
  248. .then(res => {
  249. console.log(res)
  250. that.getlist()
  251. uni.showToast({
  252. title: '删除成功'
  253. })
  254. })
  255. } else if (res.cancel) {
  256. console.log('用户点击取消');
  257. }
  258. },
  259. })
  260. },
  261. }
  262. };
  263. </script>
  264. <style>
  265. </style>
  266. <style lang="scss" scoped>
  267. view {
  268. font-size: 14px;
  269. // line-height: inherit;
  270. }
  271. .menu {
  272. position: fixed;
  273. top: 180rpx;
  274. border-bottom: #FCCF41;
  275. background-color: #FFFFFF;
  276. justify-content: space-around;
  277. height: 5%;
  278. width: 100%;
  279. display: flex;
  280. z-index: 10;
  281. }
  282. .menu-item p {
  283. font-weight: 600;
  284. &.lor {
  285. border-bottom: 5rpx solid #F0D232;
  286. color: #F0D232;
  287. padding-bottom: 15rpx;
  288. }
  289. }
  290. .signup {
  291. box-shadow: 0rpx 5rpx 40rpx #ccc;
  292. width: 100%;
  293. position: fixed;
  294. bottom: 0rpx;
  295. display: flex;
  296. height: 90rpx;
  297. background-color: #FFFFFF;
  298. justify-content: space-around;
  299. ;
  300. /* 垂直居中 */
  301. align-items: center;
  302. }
  303. .signupbtn p {
  304. font-size: 28rpx;
  305. }
  306. .manu-btn {
  307. width: 120%;
  308. text-align: center;
  309. border: 1rpx solid #FCCF41;
  310. background-color: #FFFFFF;
  311. border-radius: 10rpx;
  312. color: #000000;
  313. font-size: 28rpx;
  314. line-height: 180%;
  315. margin-left: 10%;
  316. }
  317. .auto-btn {
  318. width: 300rpx;
  319. text-align: center;
  320. background-color: #FCCF41;
  321. border-radius: 10rpx;
  322. color: #FFFFFF;
  323. font-size: 28rpx;
  324. line-height: 180%;
  325. margin-right: 10%;
  326. display: flex;
  327. justify-content: center;
  328. align-items: center;
  329. }
  330. .auto-text {
  331. display: inline-block;
  332. }
  333. .weixinlogo {
  334. display: inline-block;
  335. padding-right: 5rpx;
  336. width: 35rpx;
  337. height: 35rpx;
  338. }
  339. .radio {
  340. color: #F0D232;
  341. }
  342. .taskimg {
  343. width: 30rpx;
  344. height: 30rpx;
  345. background-image: url(../../static/home/home12.png);
  346. background-size: 30rpx;
  347. background-repeat: no-repeat;
  348. box-sizing: border-box;
  349. display: inline-block;
  350. vertical-align: middle;
  351. &.on {
  352. background-image: url(../../static/home/home13.png);
  353. }
  354. }
  355. .func {
  356. display: flex;
  357. padding: 0 0 0 1%;
  358. }
  359. .func-btn {
  360. padding-left: 20rpx;
  361. }
  362. .func-btn span {
  363. color: #333333;
  364. font-size: 30rpx;
  365. font-weight: 500;
  366. text-indent: 2em;
  367. }
  368. .func-btn image {
  369. vertical-align: middle;
  370. width: 30rpx;
  371. height: 30rpx;
  372. display: inline-block;
  373. padding-right: 14rpx;
  374. }
  375. .head-img {
  376. vertical-align: middle;
  377. width: 50rpx;
  378. height: 50rpx;
  379. display: inline-block;
  380. padding-right: 30rpx;
  381. }
  382. .ipon {
  383. color: #333333;
  384. font-size: 30rpx;
  385. font-weight: 500;
  386. margin-bottom: 10rpx;
  387. }
  388. .card {
  389. width: 88%;
  390. padding: 24rpx;
  391. margin-top: 30rpx;
  392. border-radius: 10rpx;
  393. background-color: #ffffff;
  394. margin: 0 auto;
  395. box-shadow: 0px 0px 10rpx 2rpx #CCCCCC;
  396. }
  397. .butto {
  398. text-align: center;
  399. }
  400. .option {
  401. padding: 20rpx;
  402. }
  403. .uni-margin-wrap {
  404. width: 690rpx;
  405. width: 100%;
  406. ;
  407. }
  408. .swiper {
  409. height: 300rpx;
  410. }
  411. .swiper-item {
  412. display: block;
  413. height: 300rpx;
  414. line-height: 300rpx;
  415. text-align: center;
  416. }
  417. .swiper-list {
  418. margin-top: 40rpx;
  419. margin-bottom: 0;
  420. }
  421. .uni-common-mt {
  422. margin-top: 60rpx;
  423. position: relative;
  424. }
  425. .info {
  426. position: absolute;
  427. right: 20rpx;
  428. }
  429. .uni-padding-wrap {
  430. width: 550rpx;
  431. padding: 0 100rpx;
  432. }
  433. </style>