選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

equityList.vue 6.9KB

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