index.vue 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  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" class="list">
  9. <view v-if="zt==2" class="list1">
  10. <view class="a"><text class="tit">买方战队</text>:<text class="b">{{ item.zd }}</text></view>
  11. <view class="a"><text class="tit">买方姓名</text>:{{ item.xm }}</view>
  12. <view class="a"><text class="tit">卖方手机号</text>:<text class="b">{{ item.sjh }}</text></view>
  13. <view class="a"><text class="tit">产品</text>:
  14. <text v-if="item.lx!=1">{{ item.name }}({{ item.cname }})</text>
  15. <text v-if="item.lx==1" style="color: #fff;background-color: #ED4545;padding: 5rpx 10rpx;">{{ item.name }}({{ item.cname }})</text>
  16. </view>
  17. <view class="a"><text class="tit">实收款</text>:<text class="b">{{ item.price }}元</text></view>
  18. <view class="a"><text class="tit">利润周期</text>:{{ item.tianshu }}天/{{ item.shouyi }}%</view>
  19. <view class="a"><text class="tit">状态</text>:
  20. <text class="b" v-if="item.zt == 0">待付款</text>
  21. <text class="b" v-if="item.zt == 1">已打款,待确认</text>
  22. <text class="b" v-if="item.zt == 2">已完成</text>
  23. <text class="b" v-if="item.zt == 3">已超时</text>
  24. </view>
  25. <view class="a"><text class="tit">转让时间</text>:{{ item.time }}</view>
  26. <view class="a" v-if="item.zt==0">
  27. <text class="tit">付款剩余时间</text>:
  28. <text class="b" >{{item.djssm}}</text>
  29. </view>
  30. <view class="a" v-if="item.zt==1">
  31. <text class="tit">确认剩余时间</text>:
  32. <text class="b" >{{item.djssm}}</text>
  33. </view>
  34. <view class="a" v-if="item.zt==1">交易密码验证:</view>
  35. <input class="srk" placeholder="请输入交易密码" v-model="item.jymm" v-if="item.zt==1"/>
  36. <view class="a" v-if="item.zt==1 && item.lx!=1">付款凭证:</view>
  37. <view v-if="item.zt==1 && item.lx!=1">
  38. <image v-if="item.dkpz" style="width:150rpx;height: 150rpx;" referrerpolicy="no-referrer"
  39. :src="item.dkpz"
  40. @click="viewimg(item.dkpz)"
  41. /> </text>
  42. </view>
  43. <button type="warn" style="margin-top:10rpx;background: #989898;font-size: 30rpx;margin-bottom: 20rpx;width: 50%;" v-if="item.zt==0">等待付款</button>
  44. <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>
  45. </view>
  46. <view v-if="zt==1">
  47. <view class="a"><text class="tit">产品</text>:{{ item.name }}({{ item.cname }})</view>
  48. <view class="a"><text class="tit">抢购时间</text>:{{ item.time }}</view>
  49. <view style="display: table;width: 100%;">
  50. <view style="float: left;">
  51. <view class="a"><text class="tit">支付</text>:<text class="b">{{ item.price1 }}元</text></view>
  52. <view class="a"><text class="tit">利润周期</text>:{{ item.tianshu }}天/{{ item.shouyi }}%</view>
  53. </view>
  54. <view style="float: right;background: #f4a612;color: #fff;font-size: 28rpx;padding:10rpx 20rpx;border-radius: 10rpx;" @click="ppb(item)" v-if="userinfo.quanxian==1 && (item.lx==0 || item.lx==2)">
  55. 转入拍拍宝
  56. </view>
  57. </view>
  58. <view class="a"><text class="tit">转让时间</text>:{{ item.zrtime }}</view>
  59. <button type="warn" style="margin-top:10rpx;background: #f3a511;font-size: 30rpx;margin-bottom: 20rpx;width: 50%;display: none;" @click="duihuan(item)">兑换</button>
  60. </view>
  61. <view v-if="zt==3">
  62. <view class="a"><text class="tit">产品</text>:{{ item.name }}({{ item.cname }})</view>
  63. <view class="a"><text class="tit">支付</text>:<text class="b">{{ item.price }}元</text></view>
  64. <view class="a"><text class="tit">抢购时间</text>:{{ item.time }}</view>
  65. <view class="a"><text class="tit">利润周期</text>:{{ item.tianshu }}天/{{ item.shouyi }}%</view>
  66. </view>
  67. </view>
  68. </view>
  69. </template>
  70. <script>
  71. export default {
  72. data() {
  73. return {
  74. constants: {},
  75. noimg: '/static/lanhu_record/ps3lynngrkw77ya7zb5jydv23q6xcffyj53c6fe453-54c4-4078-b021-8c1b292a08c2.png',
  76. data: {
  77. uid: '0',
  78. realname: '',
  79. idcard: '',
  80. idcardimg1: '',
  81. idcardimg2: ''
  82. },
  83. userinfo: null,
  84. qglist: [],
  85. zt:1
  86. };
  87. },
  88. onShow() {
  89. var user = this.$api.getUserinfo();
  90. if (user) {
  91. this.userinfo = user;
  92. this.data.uid = this.userinfo.id;
  93. this.data.realname = this.userinfo.xm;
  94. this.data.idcard = this.userinfo.sfz;
  95. this.data.idcardimg1 = this.userinfo.idcardimg1;
  96. this.data.idcardimg2 = this.userinfo.idcardimg2;
  97. } else {
  98. this.userinfo = null;
  99. }
  100. this.getList();
  101. },
  102. methods: {
  103. ppb(item){
  104. uni.navigateTo({
  105. url: '/pages/ppb/zhuanru?id=' + item.id
  106. });
  107. },
  108. duihuan(item){
  109. uni.navigateTo({
  110. url: 'duihuan?id='+item.id
  111. });
  112. },
  113. change(zt){
  114. this.zt=zt;
  115. this.getList();
  116. },
  117. viewimg(path) {
  118. uni.previewImage({
  119. urls: [path],
  120. longPressActions: {
  121. itemList: ['发送给朋友', '保存图片', '收藏'],
  122. success: function(data) {
  123. //// console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  124. },
  125. fail: function(err) {
  126. // console.log(err.errMsg);
  127. }
  128. }
  129. });
  130. },
  131. getList() {
  132. var data = new Object();
  133. data.uid = this.data.uid;
  134. //data.uid = 1000006;
  135. data.zt = this.zt;
  136. if (data.uid == '0') {
  137. uni.showToast({
  138. title: '请重新登录',
  139. icon: 'none'
  140. });
  141. uni.switchTab({
  142. url: '/pages/my/index'
  143. });
  144. return;
  145. }
  146. this.$api
  147. .MhPostModel(data, 'user/zrlist')
  148. .then(res => {
  149. //// console.log('user/qglist信息', JSON.stringify(res.data.data.data));
  150. //// console.log('抢购');
  151. this.qglist = res.data.data.data;
  152. })
  153. .catch(err => {
  154. // console.log('request fail', JSON.stringify(err));
  155. });
  156. },
  157. querenshoukuan(item){
  158. var that=this;
  159. uni.showModal({
  160. title: '提示',
  161. content: '是否确认收款?',
  162. success: function (res) {
  163. if (res.confirm) {
  164. //// console.log('用户点击确定');
  165. that.saveQuerenshoukuan(item);
  166. } else if (res.cancel) {
  167. //// console.log('用户点击取消');
  168. }
  169. }
  170. });
  171. },
  172. saveQuerenshoukuan(item){
  173. var data = new Object();
  174. if(item.jymm==''){
  175. uni.showToast({
  176. title: '请输入交易密码',
  177. icon: 'none'
  178. });
  179. return;
  180. }
  181. data.uid = this.userinfo.id;
  182. data.id = item.id;
  183. data.jymm = item.jymm;
  184. this.$api
  185. .MhPostModel(data, 'user/qrsk')
  186. .then(res => {
  187. //// console.log('qrsk信息', JSON.stringify(res));
  188. if (res.data.code != 1) {
  189. uni.showModal({
  190. title: '提示',
  191. content: res.data.msg,
  192. showCancel:false,
  193. success: function (res) {
  194. if (res.confirm) {
  195. console.log('用户点击确定');
  196. } else if (res.cancel) {
  197. console.log('用户点击取消');
  198. }
  199. }
  200. });
  201. return;
  202. } else {
  203. uni.showModal({
  204. title: '提示',
  205. content: res.data.msg,
  206. showCancel:false,
  207. success: function (res) {
  208. if (res.confirm) {
  209. console.log('用户点击确定');
  210. } else if (res.cancel) {
  211. console.log('用户点击取消');
  212. }
  213. }
  214. });
  215. this.getList();
  216. }
  217. })
  218. .catch(err => {
  219. // console.log('request fail', JSON.stringify(err));
  220. });
  221. }
  222. }
  223. };
  224. </script>
  225. <style lang="css">
  226. @import '../common/common.css';
  227. @import './assets/style/index.rpx.css';
  228. @import '../common/common.css';
  229. @import './assets/style/index.rpx.css';
  230. page {
  231. padding: 15rpx;
  232. background: #f2f2f6;
  233. padding: 0;
  234. margin: 0;
  235. }
  236. .a {
  237. color: #585858;
  238. font-size: 30rpx;
  239. line-height: 180%;
  240. }
  241. .tit{color: #a4a4a4;width: 130rpx;display: inline-block;text-align-last:justify}
  242. .a::before {
  243. content: '';
  244. width: 10rpx;display: inline-block;
  245. height: 10rpx;margin-right: 10rpx;position: relative;
  246. background: #aaaaaa;top: -5rpx;
  247. border-radius: 50%;
  248. }
  249. .b {
  250. color: #ED4545;
  251. font-weight: bold;
  252. }
  253. .mfxx {
  254. background: #faba25;
  255. color: #fff;
  256. font-size: 28rpx;
  257. padding: 5rpx 10rpx;
  258. border-radius: 5rpx;
  259. margin-left: 10rpx;
  260. }
  261. .srk {
  262. color: #000;
  263. height: 60rpx;
  264. line-height: 60rpx;
  265. background: #fff;
  266. border-radius: 10rpx;background: #f2f2f6;
  267. padding-left: 20rpx;
  268. font-size: 28rpx;
  269. }
  270. .list1 .a .tit{width: 180rpx;}
  271. .top {
  272. display: flex;
  273. justify-content: space-between;
  274. padding-bottom: 10rpx;
  275. background-image: linear-gradient(#829c52, #59723b);
  276. line-height: 60rpx;
  277. height: 90rpx;
  278. padding-top: 10rpx;
  279. }
  280. .xuanzhong {
  281. display: inline-block;
  282. text-align: center;
  283. width: 33%;
  284. color: #fff;
  285. }
  286. .xuanzhong::after {
  287. content: "";
  288. display: block;
  289. width: 30px;
  290. height: 5rpx;
  291. margin: auto;
  292. background: #fff;
  293. border-radius: 30rpx;
  294. }
  295. .wxz {
  296. color: #fff;
  297. display: inline-block;
  298. text-align: center;
  299. width: 33%;
  300. }
  301. .list {
  302. background: #fff;
  303. width: calc(100% - 40rpx);
  304. margin: auto;
  305. margin-top: 20rpx;
  306. padding: 20rpx;
  307. border-radius: 15rpx;
  308. }
  309. </style>