wishList.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <view class="page">
  3. <view class="list_info">
  4. <view class="item" v-for="(item,index) in 3">
  5. <view class="avator">
  6. <image class="icon" src="../../static/me/sex_2.png" mode="widthFix" />
  7. </view>
  8. <view class="left">
  9. <view class="name">iPhone15 pro max</view>
  10. <view class="jindu">
  11. <view class="bord">
  12. <view class="active" style="width:50%;"></view>
  13. </view>
  14. <text class="tips">50%</text>
  15. </view>
  16. </view>
  17. <text class="right">
  18. <view class="btn_submit" @click="onLinqu">邀请助力</view>
  19. <view class="state">待发货</view>
  20. </text>
  21. </view>
  22. <view class="blankHeight"></view>
  23. </view>
  24. <DialogBox ref="DialogBox"></DialogBox>
  25. </view>
  26. </template>
  27. <script>
  28. export default {
  29. components: {},
  30. data() {
  31. return {
  32. tab: 1,
  33. scrollTop: 0,
  34. old: {
  35. scrollTop: 0
  36. },
  37. list: [{
  38. name: '实名认证',
  39. 'desc': '',
  40. 'path': ''
  41. }]
  42. }
  43. },
  44. onLoad() {
  45. // setTimeout(function() {
  46. // uni.setNavigationBarColor({
  47. // frontColor: '#ffffff',
  48. // backgroundColor: '#00000000',
  49. // animation: {
  50. // duration: 400,
  51. // timingFunc: 'easeIn'
  52. // }
  53. // })
  54. // }, 200);
  55. },
  56. onShow() {
  57. this.loadData();
  58. },
  59. methods: {
  60. onBack() {},
  61. checkTab(tab) {
  62. this.tab = tab;
  63. // this.loadData();
  64. },
  65. onLinqu() {
  66. this.$refs['DialogBox'].confirm({
  67. title: '',
  68. content: '你还没有维护收货地址,请先维护收货地址!',
  69. DialogType: 'inquiry',
  70. btn1: '我知道了',
  71. btn2: '编辑地址',
  72. animation: 0
  73. }).then(() => {
  74. // getApp().globalData.skey = "";
  75. // uni.removeStorageSync("wapptoken")
  76. // uni.redirectTo({
  77. // url: '/pages/index/login',
  78. // })
  79. // uni.navigateBack();
  80. // uni.sendNativeEvent("logout","tt", function(e){
  81. // //关闭当前小程序
  82. // console.log("sendNativeEvent-----------回调"+JSON.stringify(e));
  83. // });
  84. })
  85. },
  86. scroll: function(e) {
  87. console.log(e)
  88. this.old.scrollTop = e.detail.scrollTop
  89. },
  90. loadData() {
  91. console.log("this.globalData", getApp().globalData);
  92. let obj2 = {
  93. is_first: 0
  94. }
  95. const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
  96. console.log(postData);
  97. uni.request({
  98. url: this.$apiHost + '/Gushi/getmyinfo', //仅为示例,并非真实接口地址。
  99. data: postData,
  100. method: 'POST',
  101. header: {
  102. 'content-type': 'application/json', //自定义请求头信息
  103. 'Access-Control-Allow-Origin': '*'
  104. },
  105. success: (res) => {
  106. console.log('data:', res.data);
  107. this.myinfo = res.data;
  108. }
  109. });
  110. },
  111. EditNickname() {
  112. let that = this;
  113. this.$refs['DialogBox'].confirm({
  114. title: '更改昵称',
  115. placeholder: '请输入修改的昵称',
  116. value: that.myinfo.nickname,
  117. DialogType: 'input',
  118. animation: 0
  119. }).then((res) => {
  120. if (res.value.length < 1) {
  121. uni.showToast({
  122. title: "请输入有效的昵称",
  123. icon: 'none'
  124. });
  125. return;
  126. }
  127. that.myinfo.nickname = res.value;
  128. let obj2 = {
  129. nickname: res.value
  130. }
  131. const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
  132. uni.request({
  133. url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
  134. data: postData,
  135. method: 'POST',
  136. header: {
  137. 'content-type': 'application/json', //自定义请求头信息
  138. 'Access-Control-Allow-Origin': '*'
  139. },
  140. success: (res) => {
  141. uni.showToast({
  142. title: res.data.str,
  143. icon: 'none'
  144. });
  145. }
  146. });
  147. })
  148. },
  149. }
  150. }
  151. </script>
  152. <style scoped lang="scss">
  153. @import 'wishList.scss';
  154. </style>