You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

equityList.vue 6.9KB

10 months ago
10 months ago
1 year ago
10 months ago
1 year ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
9 months ago
10 months ago
10 months ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. <template>
  2. <!-- <text class="btn" v-if="item.isPay==2"
  3. @click.stop="equityPaymentOrderRequest(item.id)">去支付</text> -->
  4. <view class="list" :style="{'--bgimg':`url(${$imgUrl}equiet-bg1.png)`}" v-for="(item, index) in listData" :key="index" @click="onClick(item)" :data-code="item">
  5. <image class="name" :src="`${$imgUrl}equity-name.png`"></image>
  6. <view class="right-content">
  7. <view>{{item.productName}}</view>
  8. <image class="icon-back" src="/static/image/icon-back.png" mode=""></image>
  9. </view>
  10. </view>
  11. <view v-if="listData.length==0" class="no">暂无数据</view>
  12. </template>
  13. <script setup lang='ts'>
  14. import { reactive } from "vue";
  15. import {
  16. getItem
  17. } from "@/utils/storage";
  18. import {
  19. ref
  20. } from 'vue';
  21. import {
  22. requestNew
  23. } from "@/utils/network/request.js";
  24. import {getOpenId,paymentequityapplyapp,payequitydetection,queryuserallequity} from "@/utils/network/api.js";
  25. import {
  26. stringToJson
  27. } from "@/utils/network/encryption";
  28. import { msg } from "@/utils/utils";
  29. import {onShow} from "@dcloudio/uni-app";
  30. let listData = ref([])
  31. const state = reactive({
  32. id: "", //支付id
  33. });
  34. onShow(()=>{
  35. query()
  36. })
  37. function query(){
  38. //卡券渠道类型获取单项权益列表
  39. requestNew(queryuserallequity, {
  40. type: 2,
  41. data: {
  42. couponAgencyType: ['TUHU', 'ZFB'],
  43. mobile: getItem('mobile').toString()
  44. },
  45. method: "POST",
  46. showLoading: true,
  47. }).then((item) => {
  48. let res = item
  49. console.log(res, '=========');
  50. listData.value = res.data
  51. })
  52. }
  53. function onClick(singId: any) {
  54. uni.navigateTo({
  55. url: '/subpackage/service/equity/equity?singleEquityId=' + singId.singleEquityId +
  56. '&couponAgencyType=' + singId.couponAgencyType + '&couponId=' + singId.couponId + '&equityId=' + singId.equityId+ '&purchasedEquityId=' + singId.eporderId,
  57. })
  58. }
  59. // 权益支付下单
  60. // const equityPaymentOrderRequest = (id) => {
  61. // state.id =id
  62. // // #ifdef MP-WEIXIN
  63. // uni.login({
  64. // provider: "weixin",
  65. // success: function (e) {
  66. // const options1 = {
  67. // type: 2,
  68. // data: {
  69. // "jsCode": e.code
  70. // },
  71. // method: "POST",
  72. // showLoading: true,
  73. // };
  74. // requestNew(getOpenId, options1).then((res) => {
  75. // console.log("state.id",id)
  76. // const result = res;
  77. // const openidData = stringToJson(result.data);
  78. // console.log("openidData",openidData)
  79. // const options = {
  80. // type: 2,
  81. // data: {
  82. // id: id,
  83. // payType: "EQUITY",
  84. // wxOpenid: openidData.openid,
  85. // },
  86. // method: 'POST',
  87. // showLoading: true,
  88. // }
  89. // requestNew(paymentequityapplyapp, options).then((res) => {
  90. // const data = res;
  91. // console.log("权益支付下单", data)
  92. // if (data.info == "购买权益记录已支付") {
  93. // uni.showModal({
  94. // title: '提示',
  95. // content: data.info,
  96. // showCancel: false,
  97. // success: function (res) {
  98. // if (res.confirm) {
  99. // uni.navigateBack({
  100. // delta: 2
  101. // })
  102. // }
  103. // }
  104. // });
  105. // } else {
  106. // uni.requestPayment({
  107. // provider: "wxpay",
  108. // orderInfo: "",
  109. // timeStamp: data.timestamp,
  110. // nonceStr: data.noncestr,
  111. // package: data.wxPackage ? data.wxPackage : "",
  112. // signType: data.signType,
  113. // paySign: data.sign,
  114. // success: function (e) {
  115. // console.log("支付成功", res);
  116. // // 权益支付检测
  117. // equityPaymentTestRequest().then((item : any) => {
  118. // console.log("权益支付检测", data)
  119. // msg("权益产品购买成功")
  120. // // 重新查询一遍
  121. // query()
  122. // })
  123. // },
  124. // fail: function (err) {
  125. // confirm(err, () => { }, "支付失败", false);
  126. // },
  127. // })
  128. // }
  129. // })
  130. // })
  131. // },
  132. // })
  133. // // #endif
  134. // // #ifdef MP-ALIPAY
  135. // my.getAuthCode({
  136. // scopes: 'auth_base',
  137. // success: res => {
  138. // const optionsUser = {
  139. // type: 2,
  140. // data: {
  141. // payConfigId: aliPayConfigIdTwo,
  142. // code: res.authCode
  143. // },
  144. // method: "POST",
  145. // showLoading: true,
  146. // };
  147. // console.log('支付宝用户编号请求:', optionsUser)
  148. // requestNew(obtainUserId, optionsUser).then((res) => {
  149. // console.log('支付宝用户编号返回:', res)
  150. // const data = res;
  151. // console.log("data", data)
  152. // const optionsali = {
  153. // type: 2,
  154. // data: {
  155. // id: state.id,
  156. // payType: "EQUITY",
  157. // wxOpenid: data.openId,
  158. // },
  159. // method: "POST",
  160. // showLoading: true,
  161. // };
  162. // console.log('支付下单请求:', optionsali)
  163. // requestNew(paymentequityapplyapp, optionsali).then((res) => {
  164. // const data = stringToJson(res.bizContent);
  165. // console.log('支付下单返回:', data)
  166. // my.tradePay({
  167. // // 调用统一收单交易创建接口(alipay.trade.create),获得返回字段支付宝交易号 trade_no
  168. // tradeNO: data.tranPackage,
  169. // success: res => {
  170. // console.log("支付成功", res);
  171. // if (res.resultCode != "6001") {
  172. // // 权益支付检测
  173. // equityPaymentTestRequest().then((item : any) => {
  174. // console.log("权益支付检测", data)
  175. // msg("权益产品购买成功,到【我的】权益查看")
  176. // setTimeout(() => {
  177. // uni.navigateBack({
  178. // delta: 2
  179. // })
  180. // }, 2000)
  181. // })
  182. // }
  183. // },
  184. // fail: res => {
  185. // console.log("支付失败", res);
  186. // },
  187. // });
  188. // });
  189. // });
  190. // },
  191. // fail: err => {
  192. // console.log('my.getAuthCode 调用失败', err)
  193. // }
  194. // });
  195. // // #endif
  196. // }
  197. // 权益支付检测
  198. // const equityPaymentTestRequest = () => {
  199. // const options = {
  200. // type: 2,
  201. // data: {
  202. // id: state.id,
  203. // },
  204. // method: 'POST',
  205. // showLoading: true,
  206. // }
  207. // return new Promise(async (resolve, reject) => {
  208. // const res = await requestNew(payequitydetection, options);
  209. // const data = res;
  210. // resolve(data);
  211. // }).catch((error) => {
  212. // reject(error);
  213. // });
  214. // }
  215. </script>
  216. <style>
  217. page {
  218. background: #E9EDF0;
  219. font-size: 28rpx;
  220. padding: 20rpx;
  221. box-sizing: border-box;
  222. }
  223. </style>
  224. <style lang='scss' scoped>
  225. .no{
  226. text-align: center;
  227. margin: 40rpx auto;
  228. font-size: 28rpx;
  229. }
  230. .list {
  231. background-size: 100% 100%;
  232. background-repeat: no-repeat;
  233. width: 100%;
  234. height: 168rpx;
  235. text-align: right;
  236. display: flex;
  237. align-items: center;
  238. background-image: var(--bgimg);
  239. .name{
  240. width: 60rpx;
  241. height: 60rpx;
  242. margin-left: 60rpx;
  243. margin-right: 60rpx;
  244. }
  245. .right-content{
  246. flex: 3;
  247. display: flex;
  248. align-items: center;
  249. padding: 0 20rpx 0 40rpx;
  250. box-sizing: border-box;
  251. justify-content: space-between;
  252. .icon-back{
  253. width: 26rpx;
  254. height: 36rpx;
  255. transform: rotateY(180deg);
  256. }
  257. }
  258. }
  259. </style>