wish.vue 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160
  1. <template>
  2. <view class="page">
  3. <view class="mainBody">
  4. <scroll-view class="scroll-view_H" scroll-x="true" @scroll="scroll" scroll-left="0">
  5. <view class="item" :class="{'active':tab===1}" @click="checkTab(1)">
  6. <text class="left">全部</text>
  7. <view class="line"></view>
  8. </view>
  9. <view class="item" :class="{'active':tab===2}" @click="checkTab(2)">
  10. <text class="left">数码电子</text>
  11. <view class="line"></view>
  12. </view>
  13. <view class="item" :class="{'active':tab===3}" @click="checkTab(3)">
  14. <text class="left">美妆</text>
  15. <view class="line"></view>
  16. </view>
  17. <view class="item" :class="{'active':tab===4}" @click="checkTab(4)">
  18. <text class="left">服饰</text>
  19. <view class="line"></view>
  20. </view>
  21. </scroll-view>
  22. </view>
  23. <view class="list_info">
  24. <block v-for="(item,index) in 2" :key="index">
  25. <view class="item">
  26. <view class="avator">
  27. <image class="icon" src="../../static/me/sex_2.png" mode="widthFix">
  28. </image>
  29. </view>
  30. <view class="tit">
  31. <view class="name">2023季迪奥限量款背包</view>
  32. <view class="desc">市场价:¥10,000.00</view>
  33. </view>
  34. <view class="list_mem">
  35. <image class="icon" v-for="(item,index) in 6" src="../../static/me/sex_2.png" mode="widthFix" />
  36. </view>
  37. <view class="btn_submit">加入心愿</view>
  38. </view>
  39. </block>
  40. <view class="blankHeight"></view>
  41. </view>
  42. </view>
  43. </template>
  44. <script>
  45. export default {
  46. components: {},
  47. data() {
  48. return {
  49. tab: 1,
  50. scrollTop: 0,
  51. old: {
  52. scrollTop: 0
  53. },
  54. list: [{
  55. name: '实名认证',
  56. 'desc': '',
  57. 'path': ''
  58. }]
  59. }
  60. },
  61. onLoad() {
  62. setTimeout(function() {
  63. uni.setNavigationBarColor({
  64. frontColor: '#ffffff',
  65. backgroundColor: '#00000000',
  66. animation: {
  67. duration: 400,
  68. timingFunc: 'easeIn'
  69. }
  70. })
  71. }, 200);
  72. },
  73. onShow() {
  74. this.loadData();
  75. },
  76. methods: {
  77. onBack() {},
  78. checkTab(tab) {
  79. this.tab = tab;
  80. // this.loadData();
  81. },
  82. scroll: function(e) {
  83. console.log(e)
  84. this.old.scrollTop = e.detail.scrollTop
  85. },
  86. loadData() {
  87. console.log("this.globalData", getApp().globalData);
  88. let obj2 = {
  89. is_first: 0
  90. }
  91. const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
  92. console.log(postData);
  93. uni.request({
  94. url: this.$apiHost + '/Gushi/getmyinfo', //仅为示例,并非真实接口地址。
  95. data: postData,
  96. method: 'POST',
  97. header: {
  98. 'content-type': 'application/json', //自定义请求头信息
  99. 'Access-Control-Allow-Origin': '*'
  100. },
  101. success: (res) => {
  102. console.log('data:', res.data);
  103. this.myinfo = res.data;
  104. }
  105. });
  106. },
  107. EditNickname() {
  108. let that = this;
  109. this.$refs['DialogBox'].confirm({
  110. title: '更改昵称',
  111. placeholder: '请输入修改的昵称',
  112. value: that.myinfo.nickname,
  113. DialogType: 'input',
  114. animation: 0
  115. }).then((res) => {
  116. if (res.value.length < 1) {
  117. uni.showToast({
  118. title: "请输入有效的昵称",
  119. icon: 'none'
  120. });
  121. return;
  122. }
  123. that.myinfo.nickname = res.value;
  124. let obj2 = {
  125. nickname: res.value
  126. }
  127. const postData = Object.assign({}, getApp().globalData.postHeader, obj2);
  128. uni.request({
  129. url: that.$apiHost + '/Gushi/editinfo', //检测是否已绑定
  130. data: postData,
  131. method: 'POST',
  132. header: {
  133. 'content-type': 'application/json', //自定义请求头信息
  134. 'Access-Control-Allow-Origin': '*'
  135. },
  136. success: (res) => {
  137. uni.showToast({
  138. title: res.data.str,
  139. icon: 'none'
  140. });
  141. }
  142. });
  143. })
  144. },
  145. }
  146. }
  147. </script>
  148. <style scoped lang="scss">
  149. @import 'wish.scss';
  150. </style>