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.

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