index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230
  1. <template>
  2. <view>
  3. <view class="top">
  4. <view :class="zt==1?'xuanzhong':'wxz'" @click="change(1);">待转让</view>
  5. <view :class="zt==2?'xuanzhong':'wxz'" @click="change(2);">转让中</view>
  6. <view :class="zt==3?'xuanzhong':'wxz'" @click="change(3);">已完成</view>
  7. </view>
  8. <view v-for="(item, index) in qglist" style="margin: 20rpx;border-bottom: #fff solid 1rpx;padding-bottom: 20rpx;">
  9. <view v-if="zt==2">
  10. <view class="a">买方战队:<text class="b">{{ item.zd }}</text></view>
  11. <view class="a">买方姓名:{{ item.xm }}</view>
  12. <view class="a">卖方手机号:<text class="b">{{ item.sjh }}</text></view>
  13. <view class="a">产品:{{ item.name }}({{ item.cname }})</view>
  14. <view class="a">实收款:<text class="b">{{ item.price }}元</text></view>
  15. <view class="a">利润周期:{{ item.tianshu }}天/{{ item.shouyi }}%</view>
  16. <view class="a">状态:
  17. <text class="b" v-if="item.zt == 0">待付款</text>
  18. <text class="b" v-if="item.zt == 1">已打款,待确认</text>
  19. <text class="b" v-if="item.zt == 2">已完成</text>
  20. <text class="b" v-if="item.zt == 3">已超时</text>
  21. </view>
  22. <view class="a">转让时间:{{ item.time }}</view>
  23. <view class="a" v-if="item.zt==0">
  24. <view style="float: left;">付款剩余时间:</view>
  25. <text class="b" >{{item.djssm}}</text>
  26. </view>
  27. <view class="a" v-if="item.zt==1">
  28. <view style="float: left;">确认剩余时间:</view>
  29. <text class="b" >{{item.djssm}}</text>
  30. </view>
  31. <view class="a" v-if="item.zt==1">交易密码验证:</view>
  32. <input class="srk" placeholder="请输入交易密码" v-model="item.jymm" v-if="item.zt==1"/>
  33. <view class="a" v-if="item.zt==1">付款凭证:</view>
  34. <view v-if="item.zt==1">
  35. <image v-if="item.dkpz" style="width:150rpx;height: 150rpx;" referrerpolicy="no-referrer"
  36. :src="item.dkpz"
  37. @click="viewimg(item.dkpz)"
  38. />
  39. </view>
  40. <button type="warn" style="margin-top:10rpx;background: #989898;font-size: 30rpx;margin-bottom: 20rpx;width: 50%;" v-if="item.zt==0">等待付款</button>
  41. <button type="warn" style="margin-top:10rpx;background: #f3a511;font-size: 30rpx;margin-bottom: 20rpx;width: 50%;" @click="querenshoukuan(item)" v-if="item.zt==1">我已收到款</button>
  42. </view>
  43. <view v-if="zt==1">
  44. <view class="a">产品:{{ item.name }}({{ item.cname }})</view>
  45. <view class="a">支付:<text class="b">{{ item.price1 }}元</text></view>
  46. <view class="a">抢购时间:{{ item.time }}</view>
  47. <view class="a">利润周期:{{ item.tianshu }}天/{{ item.shouyi }}%</view>
  48. <view class="a">转让时间:{{ item.zrtime }}</view>
  49. <button type="warn" style="margin-top:10rpx;background: #f3a511;font-size: 30rpx;margin-bottom: 20rpx;width: 50%;" @click="duihuan(item)">兑换</button>
  50. </view>
  51. <view v-if="zt==3">
  52. <view class="a">产品:{{ item.name }}({{ item.cname }})</view>
  53. <view class="a">支付:<text class="b">{{ item.price }}元</text></view>
  54. <view class="a">抢购时间:{{ item.time }}</view>
  55. <view class="a">利润周期:{{ item.tianshu }}天/{{ item.shouyi }}%</view>
  56. </view>
  57. </view>
  58. </view>
  59. </template>
  60. <script>
  61. export default {
  62. data() {
  63. return {
  64. constants: {},
  65. noimg: '/static/lanhu_record/ps3lynngrkw77ya7zb5jydv23q6xcffyj53c6fe453-54c4-4078-b021-8c1b292a08c2.png',
  66. data: {
  67. uid: '0',
  68. realname: '',
  69. idcard: '',
  70. idcardimg1: '',
  71. idcardimg2: ''
  72. },
  73. userinfo: null,
  74. qglist: [],
  75. zt:1,
  76. page:1,
  77. status: 'more',
  78. contentText: {
  79. contentdown: '上拉加载更多',
  80. contentrefresh: '加载中',
  81. contentnomore: '到底了'
  82. }
  83. };
  84. },
  85. onShow() {
  86. var user = this.$api.getUserinfo();
  87. if (user) {
  88. this.userinfo = user;
  89. this.data.uid = this.userinfo.id;
  90. this.data.realname = this.userinfo.xm;
  91. this.data.idcard = this.userinfo.sfz;
  92. this.data.idcardimg1 = this.userinfo.idcardimg1;
  93. this.data.idcardimg2 = this.userinfo.idcardimg2;
  94. } else {
  95. this.userinfo = null;
  96. }
  97. this.getList();
  98. },
  99. methods: {
  100. duihuan(item){
  101. uni.navigateTo({
  102. url: 'duihuan?id='+item.id
  103. });
  104. },
  105. change(zt){
  106. this.zt=zt;
  107. this.page=1;
  108. this.qglist=[]
  109. this.getList();
  110. },
  111. viewimg(path) {
  112. uni.previewImage({
  113. urls: [path],
  114. longPressActions: {
  115. itemList: ['发送给朋友', '保存图片', '收藏'],
  116. success: function(data) {
  117. //// console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  118. },
  119. fail: function(err) {
  120. // console.log(err.errMsg);
  121. }
  122. }
  123. });
  124. },
  125. getList() {
  126. var data = new Object();
  127. data.uid = this.data.uid;
  128. data.zt = this.zt;
  129. if (data.uid == '0') {
  130. uni.showToast({
  131. title: '请重新登录',
  132. icon: 'none'
  133. });
  134. uni.switchTab({
  135. url: '/pages/my/index'
  136. });
  137. return;
  138. }
  139. this.$api
  140. .MhPostModel(data, 'user/zrlist')
  141. .then(res => {
  142. var shuju = res.data.data.data;
  143. this.qglist = shuju
  144. this.status = 'more';
  145. if (shuju.length == 0) {
  146. this.status = 'nomore';
  147. }
  148. })
  149. .catch(err => {
  150. // console.log('request fail', JSON.stringify(err));
  151. });
  152. },
  153. querenshoukuan(item){
  154. var that=this;
  155. uni.showModal({
  156. title: '提示',
  157. content: '是否确认收款?',
  158. success: function (res) {
  159. if (res.confirm) {
  160. //// console.log('用户点击确定');
  161. that.saveQuerenshoukuan(item);
  162. } else if (res.cancel) {
  163. //// console.log('用户点击取消');
  164. }
  165. }
  166. });
  167. },
  168. saveQuerenshoukuan(item){
  169. var data = new Object();
  170. if(item.jymm==''){
  171. uni.showToast({
  172. title: '请输入交易密码',
  173. icon: 'none'
  174. });
  175. return;
  176. }
  177. data.uid = this.userinfo.id;
  178. data.id = item.id;
  179. data.jymm = item.jymm;
  180. this.$api
  181. .MhPostModel(data, 'user/qrsk')
  182. .then(res => {
  183. //// console.log('qrsk信息', JSON.stringify(res));
  184. if (res.data.code != 1) {
  185. uni.showToast({
  186. title: res.data.msg,
  187. icon: 'none'
  188. });
  189. return;
  190. } else {
  191. uni.showToast({
  192. title: res.data.msg,
  193. icon: 'none'
  194. });
  195. this.getList();
  196. }
  197. })
  198. .catch(err => {
  199. // console.log('request fail', JSON.stringify(err));
  200. });
  201. }
  202. }
  203. };
  204. </script>
  205. <style lang="css">
  206. @import '../common/common.css';
  207. @import './assets/style/index.rpx.css';
  208. @import '../common/common.css';
  209. @import './assets/style/index.rpx.css';
  210. page{padding: 15rpx;background: #98a737;background-attachment: fixed !important;
  211. background-repeat: no-repeat !important;}
  212. .a{color: #fff;font-size: 30rpx;line-height: 180%;}
  213. .b{color: #ef0000;font-weight: bold;}
  214. .mfxx{background: #faba25;color: #fff;font-size: 28rpx;padding: 5rpx 10rpx;border-radius: 5rpx;margin-left: 10rpx;}
  215. .srk {
  216. color: #000;
  217. height: 60rpx;
  218. line-height: 60rpx;
  219. background: #fff;
  220. border-radius: 10rpx;
  221. padding-left: 20rpx;
  222. font-size: 30rpx;
  223. }
  224. .top{display: flex;justify-content: space-between;border-bottom: #fff solid 1rpx;line-height: 60rpx;padding-bottom: 10rpx;}
  225. .xuanzhong{color: #fff;background: #8a9e0a;display: inline-block;text-align: center;width: 33%;}
  226. .wxz{color: #fff;display: inline-block;text-align: center;width: 33%;}
  227. </style>