index.vue 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408
  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" :key="index" class="list">
  9. <view v-if="zt==1" 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>:{{ item.ddh }}</view>
  14. <view class="a"><text class="tit">产品</text>:
  15. <text v-if="item.lx!=1">{{ item.name }}({{ item.cname }})</text>
  16. <text v-if="item.lx==1" style="color: #fff;background-color: #ED4545;padding: 5rpx 10rpx;">{{ item.name }}({{ item.cname }})</text>
  17. </view>
  18. <view class="a"><text class="tit">支付</text>:<text class="b">{{ item.price }}元</text></view>
  19. <view class="a"><text class="tit">利润周期</text>:{{ item.tianshu }}天/{{ item.shouyi }}%</view>
  20. <view class="a"><text class="tit">获得收益</text>:<text class="b">{{ item.hdshouyi }}元</text></view>
  21. <view class="a"><text class="tit">转让时间</text>:{{ item.time }}</view>
  22. <view class="a"><text class="tit">状态</text>:
  23. <text class="b" v-if="item.zt == 0">待付款</text>
  24. <text class="b" v-if="item.zt == 1">已打款,待确认</text>
  25. <text class="b" v-if="item.zt == 2">确认打款</text>
  26. <text class="b" v-if="item.zt == 3">已超时</text>
  27. <text @click="mfxx(item.uid,item.lx)" class="mfxx" v-if="item.zt==0 && item.lx!=1">卖方信息</text>
  28. <text class="b" v-if="item.zt==0 && item.lx==1">输入支付密码系统自动扣款</text>
  29. </view>
  30. <view class="a" v-if="item.zt==0">
  31. <text class="tit">付款剩余时间</text>:
  32. <text class="b">{{item.djssm}}</text>
  33. </view>
  34. <view class="a" v-if="item.zt==1">
  35. <view style="float: left;">确认剩余时间:</view>
  36. <text class="b">{{item.djssm}}</text>
  37. </view>
  38. <view class="a" v-if="item.zt==0">交易密码验证:</view>
  39. <input class="srk" placeholder="请输入交易密码" v-model="item.jymm" v-if="item.zt==0" />
  40. <view class="a" v-if="item.lx!=1">付款凭证:</view>
  41. <view v-if="item.lx!=1">
  42. <image v-if="item.dkpz" style="width:150rpx;height: 150rpx;" referrerpolicy="no-referrer"
  43. :src="item.dkpz" @click="viewimg(item.dkpz)" />
  44. <image v-else style="width: 150rpx;height: 150rpx;" referrerpolicy="no-referrer"
  45. src="/static/xj.png" @click="shangchuanpingzheng(item,index)" />
  46. </view>
  47. <button type="warn"
  48. style="margin-top:10rpx;background: #f3a511;font-size: 30rpx;margin-bottom: 20rpx;width: 50%;"
  49. @click="saveShangchuanpingzheng(item)" v-if="item.zt==0">我已打款</button>
  50. <button type="warn"
  51. style="margin-top:10rpx;background: #989898;font-size: 30rpx;margin-bottom: 20rpx;width: 50%;"
  52. v-if="item.zt==1">等待对方确认</button>
  53. </view>
  54. <view v-if="zt==2">
  55. <view class="a"><text class="tit">产品</text>:{{ item.name }}({{ item.cname }})</view>
  56. <view class="a"><text class="tit">支付</text>:<text class="b">{{ item.price1 }}元</text></view>
  57. <view style="display: table;width: 100%;">
  58. <view style="float: left;">
  59. <view class="a"><text class="tit">利润周期</text>:{{ item.tianshu }}天/{{ item.shouyi }}%</view>
  60. <view class="a"><text class="tit">获得收益</text>:<text class="b">{{ item.hdshouyi }}元</text></view>
  61. </view>
  62. <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)">
  63. 转入拍拍宝
  64. </view>
  65. </view>
  66. <view class="a"><text class="tit">获得时间</text>:{{ item.time }}</view>
  67. <view class="a"><text class="tit">转让时间</text>:{{ item.zrtime }}</view>
  68. </view>
  69. <view v-if="zt==3">
  70. <view class="a">
  71. <text class="tit">产品</text>:{{ item.name }}({{ item.cname }})
  72. </view>
  73. <view class="a"><text class="tit">支付</text>:<text class="b">{{ item.price }}元</text></view>
  74. <view class="a"><text class="tit">匹配时间</text>:{{ item.time }}</view>
  75. <view class="a"><text class="tit">利润周期</text>:{{ item.tianshu }}天/{{ item.shouyi }}%</view>
  76. </view>
  77. </view>
  78. </view>
  79. </template>
  80. <script>
  81. export default {
  82. data() {
  83. return {
  84. constants: {},
  85. noimg: '/static/lanhu_record/ps3lynngrkw77ya7zb5jydv23q6xcffyj53c6fe453-54c4-4078-b021-8c1b292a08c2.png',
  86. data: {
  87. uid: '0',
  88. realname: '',
  89. idcard: '',
  90. idcardimg1: '',
  91. idcardimg2: ''
  92. },
  93. userinfo: null,
  94. qglist: [],
  95. zt: 1,
  96. page: 1,
  97. status: 'more',
  98. contentText: {
  99. contentdown: '上拉加载更多',
  100. contentrefresh: '加载中',
  101. contentnomore: '到底了'
  102. }
  103. };
  104. },
  105. onShow() {
  106. var user = this.$api.getUserinfo();
  107. if (user) {
  108. this.userinfo = user;
  109. this.data.uid = this.userinfo.id;
  110. this.data.realname = this.userinfo.xm;
  111. this.data.idcard = this.userinfo.sfz;
  112. this.data.idcardimg1 = this.userinfo.idcardimg1;
  113. this.data.idcardimg2 = this.userinfo.idcardimg2;
  114. } else {
  115. this.userinfo = null;
  116. }
  117. this.getList();
  118. },
  119. methods: {
  120. ppb(item){
  121. uni.navigateTo({
  122. url: '/pages/ppb/zhuanru?id=' + item.id
  123. });
  124. },
  125. change(zt) {
  126. this.zt = zt;
  127. this.page = 1;
  128. this.qglist = []
  129. this.getList();
  130. },
  131. mfxx(uid,lx) {
  132. uni.navigateTo({
  133. url: '/pages/shoukuan/mfxx?id=' + uid+'&lx='+lx
  134. });
  135. },
  136. viewimg(path) {
  137. uni.previewImage({
  138. urls: [path],
  139. longPressActions: {
  140. itemList: ['发送给朋友', '保存图片', '收藏'],
  141. success: function(data) {
  142. //// console.log('选中了第' + (data.tapIndex + 1) + '个按钮,第' + (data.index + 1) + '张图片');
  143. },
  144. fail: function(err) {
  145. // console.log(err.errMsg);
  146. }
  147. }
  148. });
  149. },
  150. getList() {
  151. var data = new Object();
  152. data.uid = this.data.uid;
  153. //data.uid=1000006;
  154. data.page = this.page;
  155. data.zt = this.zt;
  156. if (data.uid == '0') {
  157. uni.showToast({
  158. title: '请重新登录',
  159. icon: 'none'
  160. });
  161. uni.switchTab({
  162. url: '/pages/my/index'
  163. });
  164. return;
  165. }
  166. this.$api
  167. .MhPostModel(data, 'user/qglist')
  168. .then(res => {
  169. var shuju = res.data.data.data;
  170. //console.log(res.data.quanxian)
  171. this.qglist = shuju
  172. this.status = 'more';
  173. if (shuju.length == 0) {
  174. this.status = 'nomore';
  175. }
  176. })
  177. .catch(err => {
  178. // console.log('request fail', JSON.stringify(err));
  179. });
  180. },
  181. onClick_1() {
  182. var data = new Object();
  183. data.uid = this.data.uid;
  184. data.xm = this.data.realname;
  185. data.sfz = this.data.idcard;
  186. if (this.userinfo.idcradstatus == 1) {
  187. uni.showToast({
  188. title: '已认证,无需重新认证',
  189. icon: 'none'
  190. });
  191. return;
  192. }
  193. if (data.uid == '0') {
  194. uni.showToast({
  195. title: '请重新登录',
  196. icon: 'none'
  197. });
  198. uni.switchTab({
  199. url: '/pages/my/index'
  200. });
  201. return;
  202. }
  203. this.$api
  204. .MhPostModel(data, 'user/shiming')
  205. .then(res => {
  206. //// console.log('MhUserRenzheng信息', JSON.stringify(res));
  207. if (res.data.code != 1) {
  208. uni.showToast({
  209. title: res.data.msg,
  210. icon: 'none'
  211. });
  212. this.getCode();
  213. return;
  214. } else {
  215. uni.showToast({
  216. title: res.data.msg,
  217. icon: 'none'
  218. });
  219. }
  220. })
  221. .catch(err => {
  222. // console.log('request fail', JSON.stringify(err));
  223. });
  224. },
  225. shangchuanpingzheng(item, index) {
  226. var that = this;
  227. uni.chooseImage({
  228. count: 1, //默认9
  229. sizeType: ['original', 'compressed'], //可以指定是原图还是压缩图,默认二者都有
  230. sourceType: ['album'], //从相册选择
  231. success: function(res) {
  232. // console.log(JSON.stringify(res.tempFilePaths));
  233. uni.uploadFile({
  234. url: that.$api.getUploadurl2,
  235. filePath: res.tempFilePaths[0],
  236. name: 'file',
  237. success: function(res) {
  238. //// console.log(res.data);
  239. var path = res.data;
  240. path = JSON.parse(path).data.url;
  241. that.qglist[index].dkpz = path;
  242. //that.saveShangchuanpingzheng(item, path);
  243. }
  244. });
  245. }
  246. });
  247. },
  248. saveShangchuanpingzheng(item) {
  249. var data = new Object();
  250. if (item.jymm == '') {
  251. uni.showToast({
  252. title: '请输入交易密码',
  253. icon: 'none'
  254. });
  255. return;
  256. }
  257. if (item.dkpz == '' && item.lx!=1) {
  258. uni.showToast({
  259. title: '请输入付款凭证',
  260. icon: 'none'
  261. });
  262. return;
  263. }
  264. data.uid = this.userinfo.id;
  265. data.id = item.id;
  266. data.fkpz = item.dkpz;
  267. data.jymm = item.jymm;
  268. this.$api
  269. .MhPostModel(data, 'user/fkpz')
  270. .then(res => {
  271. if (res.data.code != 1) {
  272. uni.showModal({
  273. title: '提示',
  274. content: res.data.msg,
  275. showCancel: false,
  276. success: function(res) {
  277. if (res.confirm) {
  278. console.log('用户点击确定');
  279. } else if (res.cancel) {
  280. console.log('用户点击取消');
  281. }
  282. }
  283. });
  284. return;
  285. } else {
  286. uni.showModal({
  287. title: '提示',
  288. content: res.data.msg,
  289. showCancel: false,
  290. success: function(res) {
  291. if (res.confirm) {
  292. console.log('用户点击确定');
  293. } else if (res.cancel) {
  294. console.log('用户点击取消');
  295. }
  296. }
  297. });
  298. this.page = 1;
  299. this.qglist = []
  300. this.getList();
  301. }
  302. })
  303. .catch(err => {
  304. // console.log('request fail', JSON.stringify(err));
  305. });
  306. }
  307. }
  308. };
  309. </script>
  310. <style lang="css">
  311. @import '../common/common.css';
  312. @import './assets/style/index.rpx.css';
  313. page {
  314. padding: 15rpx;
  315. background: #f2f2f6;
  316. padding: 0;
  317. margin: 0;
  318. }
  319. .a {
  320. color: #585858;
  321. font-size: 30rpx;
  322. line-height: 180%;
  323. }
  324. .tit{color: #a4a4a4;width: 130rpx;display: inline-block;text-align-last:justify}
  325. .a::before {
  326. content: '';
  327. width: 10rpx;display: inline-block;
  328. height: 10rpx;margin-right: 10rpx;position: relative;
  329. background: #aaaaaa;top: -5rpx;
  330. border-radius: 50%;
  331. }
  332. .b {
  333. color: #ED4545;
  334. font-weight: bold;
  335. }
  336. .mfxx {
  337. background: #faba25;
  338. color: #fff;
  339. font-size: 28rpx;
  340. padding: 5rpx 10rpx;
  341. border-radius: 5rpx;
  342. margin-left: 10rpx;
  343. }
  344. .srk {
  345. color: #000;
  346. height: 60rpx;
  347. line-height: 60rpx;
  348. background: #fff;
  349. border-radius: 10rpx;background: #f2f2f6;
  350. padding-left: 20rpx;
  351. font-size: 28rpx;
  352. }
  353. .list1 .a .tit{width: 180rpx;}
  354. .top {
  355. display: flex;
  356. justify-content: space-between;
  357. padding-bottom: 10rpx;
  358. background-image: linear-gradient(#829c52, #59723b);
  359. line-height: 60rpx;
  360. height: 90rpx;
  361. padding-top: 10rpx;
  362. }
  363. .xuanzhong {
  364. display: inline-block;
  365. text-align: center;
  366. width: 33%;
  367. color: #fff;
  368. }
  369. .xuanzhong::after {
  370. content: "";
  371. display: block;
  372. width: 30px;
  373. height: 5rpx;
  374. margin: auto;
  375. background: #fff;
  376. border-radius: 30rpx;
  377. }
  378. .wxz {
  379. color: #fff;
  380. display: inline-block;
  381. text-align: center;
  382. width: 33%;
  383. }
  384. .list {
  385. background: #fff;
  386. width: calc(100% - 40rpx);
  387. margin: auto;
  388. margin-top: 20rpx;
  389. padding: 20rpx;
  390. border-radius: 15rpx;
  391. }
  392. </style>