用工小程序前端代码
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.

242 lines
8.0 KiB

10 months ago
10 months ago
7 months ago
7 months ago
10 months ago
10 months ago
7 months ago
10 months ago
10 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
7 months ago
10 months ago
10 months ago
7 months ago
10 months ago
10 months ago
10 months ago
7 months ago
7 months ago
7 months ago
10 months ago
7 months ago
7 months ago
7 months ago
10 months ago
10 months ago
16 hours ago
7 months ago
7 months ago
7 months ago
7 months ago
10 months ago
7 months ago
7 months ago
6 days ago
7 months ago
7 months ago
7 months ago
16 hours ago
7 months ago
7 months ago
10 months ago
6 days ago
10 months ago
  1. <template>
  2. <view class="se-p-40 se-bgc-f5">
  3. <view class="se-flex se-flex-v-sa se-flex-ai-fs se-py-20 se-px-30 se-bs se-bgc-white se-br-20">
  4. <view class="se-flex">
  5. <view class="se-w-160 se-h-160">
  6. <image class="se-w-160 se-h-160 se-br-10" :src="
  7. items.employJob &&
  8. items.employJob.image" mode="aspectFill"></image>
  9. </view>
  10. <view class="se-ml-20 se-flex se-flex-v-sa se-flex-ai-fs">
  11. <view class="se-fw-6 se-c-black se-fs-30 se-display-ib">{{items.title}}</view>
  12. <view class="se-fs-24 se-c-text-third se-display-ib">所属行业:{{items.categoryOne}}</view>
  13. <!-- <view class="se-fs-24 se-c-text-third se-display-ib">所属工种:中午搬运</view> -->
  14. <view class="se-fs-24 se-c-text-third se-display-ib">所属工种:{{items.categoryTwo}}</view>
  15. </view>
  16. </view>
  17. </view>
  18. <view class="se-flex se-flex-h-fs se-mt-30 se-py-20 se-px-30 se-bs se-bgc-white se-br-20">
  19. <image class="se-a-30" src="@/static/image/46502.png" mode=""></image>
  20. <text class="se-c-black se-fs-32 se-ml-20">{{items.workName}}</text>
  21. <text class="se-c-black se-fs-32 se-ml-20">{{items.workPhone}}</text>
  22. </view>
  23. <view class="se-flex se-flex-h-fs se-mt-30 se-py-20 se-px-30 se-bs se-bgc-white se-br-20">
  24. <text class="se-c-black se-fs-28">联系地址{{items.workAddress}}</text>
  25. </view>
  26. <view class="se-py-20 se-mt-10">
  27. <view class="se-flex se-flex-ai-c se-pb-10">
  28. <view class="line-orange"></view>
  29. <view class="se-ml-10 se-fs-30 se-c-black se-fw-5">
  30. 购买保险(可选)
  31. </view>
  32. <view class="se-ml-auto se-fs-28 se-c-orange se-fw-6" v-if="items.premium">
  33. {{items.premium}}
  34. </view>
  35. </view>
  36. </view>
  37. <view class="se-mt-10 se-py-30 se-px-30 se-bs se-bgc-white se-br-20">
  38. <u-radio-group
  39. size="18"
  40. v-model="payRadio"
  41. iconPlacement="right">
  42. <view class="se-flex-v-sb se-w-p-100" style="align-items: unset;">
  43. <u-radio name="1" activeColor="#ff7a31">
  44. <view class="se-flex se-flex-ai-c se-pb-20">
  45. <image class="se-w-30 se-h-25 se-mt-5" src="@/static/image/46518.png" mode=""></image>
  46. <text class="se-c-black se-fs-30 se-ml-15">账户余额</text>
  47. <text class="se-c-text-third se-fs-28 se-ml-15">(余额{{myMoney}})</text>
  48. </view>
  49. </u-radio>
  50. <u-radio name="2" activeColor="#ff7a31">
  51. <view class="se-flex se-flex-ai-c se-pt-20">
  52. <image class="se-w-35 se-h-30 se-mt-5" src="@/static/image/46662.png" mode=""></image>
  53. <text class="se-c-black se-fs-30 se-ml-15">微信支付</text>
  54. </view>
  55. </u-radio>
  56. </view>
  57. </u-radio-group>
  58. </view>
  59. <view class="se-mt-10 se-py-10 se-br-20">
  60. <text class="se-c-66 se-fs-22">温馨提示下单前请仔细查看下单需知</text>
  61. <view class="se-flex-h-fs se-br-40 se-mt-20 se-flex-ai-fs se-h-80 se-lh-80 se-ta-c se-fs-24 se-c-33" style="align-items: unset;">
  62. <u-checkbox-group @change="checkboxChange" v-model="checked">
  63. <u-checkbox name="true" activeColor="#ff7a31" label-size="12" shape="circle" label="阅读并同意"></u-checkbox>
  64. </u-checkbox-group>
  65. <!-- <u-checkbox v-model="checked" activeColor="#ff7a31" label-size="12" shape="circle" label="阅读并同意"></u-checkbox> -->
  66. <text class="se-c-orange" @click="show=true">用户使用协议</text>
  67. </view>
  68. </view>
  69. <view class="se-pos-fixed se-pos-lb se-bs-t se-flex se-flex-h-sb se-pb-60 se-pt-20 se-bgc-white se-w-vw-100">
  70. <view class="se-fs-32 se-c-black se-ml-30" @click="onDetail()">
  71. <text class="se-fs-24">合计</text>
  72. <text class="se-c-orange">{{totalAmount}}</text>
  73. </view>
  74. <view class="se-flex se-mr-30">
  75. <view @click="onReject()" class="se-mr-20 se-w-120 se-h-80 se-lh-80 se-ta-c se-c-orange se-fs-28 se-br-40 se-b se-bc-orange">
  76. 拒绝
  77. </view>
  78. <view @click="onPay()" class="se-w-240 se-h-80 se-lh-80 se-ta-c se-c-white se-fs-32 se-br-40 se-bgc-orange">
  79. 立即支付
  80. </view>
  81. </view>
  82. </view>
  83. <u-popup :show="show" :custom-style="{alignItems:'center'}" mode="center" bg-color="transparent">
  84. <view class="se-w-600 se-bgc-white se-br-40 se-p-40">
  85. <view class="se-flex se-flex-h-c se-fs-34 se-fw-6 se-c-black se-mt-0">
  86. 用户使用协议
  87. </view>
  88. <view class="se-lh-40 se-mt-40 se-fs-24 se-c-99">
  89. <u-parse :content="getValueByName('yhsyxx')"></u-parse>
  90. </view>
  91. <view class="se-flex se-flex-h-sb se-mt-40">
  92. <view @click="show=false" class="se-br-20 se-flex-1 se-flex-h-c se-h-80 se-lh-80 se-ta-c se-fs-32 se-c-white se-bgc-orange">
  93. <text>确认</text>
  94. </view>
  95. </view>
  96. </view>
  97. </u-popup>
  98. <!-- 免责声明组件 -->
  99. <disclaimer-modal ref="disclaimerModal" @cancel="onDisclaimerCancel" @confirm="onDisclaimerConfirm"></disclaimer-modal>
  100. </view>
  101. </template>
  102. <script>
  103. import {
  104. getTaskById,orderTask,orderDetail,userInfo,payOrder
  105. } from "@/common/api.js"
  106. import DisclaimerModal from "@/components/disclaimer/index.vue"
  107. export default{
  108. components: {
  109. DisclaimerModal
  110. },
  111. data(){
  112. return{
  113. show:false,
  114. id:"",
  115. checked:[],
  116. insuranceChecked:[], // 保险选择状态
  117. myMoney:"",//账户余额
  118. items:{},
  119. amount:"9.9",
  120. payRadio:"1",
  121. sysList:[]
  122. }
  123. },
  124. computed: {
  125. // 计算总金额(只显示保险费用,因为这是保险支付页面)
  126. totalAmount() {
  127. return this.items.premium;
  128. }
  129. },
  130. onLoad(options) {
  131. // this.sysList = uni.getStorageSync('sysList')
  132. console.info(options)
  133. this.id = options.id
  134. this.getOrderDetail()
  135. },
  136. onShow() {
  137. this.onUserInfo()
  138. },
  139. methods:{
  140. getValueByName(name) {
  141. const item = this.sysList.find((item) => item.name == name);
  142. return item ? item.value : "";
  143. },
  144. onUserInfo(){
  145. let params={}
  146. userInfo(params).then(response=>{
  147. console.info("userInfo",response)
  148. this.myMoney=response.result.amount?response.result.amount:0
  149. }).catch(error=>{
  150. })
  151. },
  152. checkboxChange(n) {
  153. console.log('change', n);
  154. },
  155. insuranceCheckboxChange(n) {
  156. console.log('insurance change', n);
  157. },
  158. getOrderDetail(){
  159. orderDetail({orderId:this.id}).then(response=>{
  160. console.info('orderDetail',response)
  161. this.items = response.result
  162. }).catch(error=>{
  163. })
  164. },
  165. onPay(){
  166. // 根据用户的保险选择来决定是否购买保险
  167. const buyInsurance = true
  168. // const buyInsurance = this.insuranceChecked.includes('true');
  169. this.payWithInsurance(buyInsurance);
  170. },
  171. onReject(){
  172. this.$refs.disclaimerModal.open();
  173. },
  174. onDisclaimerCancel(){
  175. // 取消免责声明,不执行任何操作
  176. },
  177. onDisclaimerConfirm(){
  178. // 确认免责声明,继续不购买保险的支付流程
  179. this.payWithInsurance(false);
  180. },
  181. payWithInsurance(buyInsurance){
  182. let that = this
  183. console.info(that.checked)
  184. if(that.checked.length==0){
  185. return uni.showToast({
  186. icon: "none",
  187. title: "请勾选隐私协议"
  188. })
  189. }
  190. let data = {
  191. orderId : that.id,
  192. payType : that.payRadio,
  193. buyInsurance: buyInsurance // 新增参数,表示是否购买保险
  194. }
  195. payOrder(data).then(res=>{
  196. if(data.payType == '2'){
  197. uni.requestPayment({
  198. provider: 'wxpay', // 服务提提供商
  199. timeStamp: res.result.timeStamp, // 时间戳
  200. nonceStr: res.result.nonceStr, // 随机字符串
  201. package: res.result.packageValue,
  202. signType: res.result.signType, // 签名算法
  203. paySign: res.result.paySign, // 签名
  204. success: function (res) {
  205. that.onDetail();
  206. },
  207. fail: function (err) {
  208. uni.showToast({
  209. icon:'none',
  210. title:"支付失败"
  211. })
  212. }
  213. });
  214. }else if(res.code == 200){
  215. that.onDetail();
  216. }
  217. }).catch(error=>{
  218. })
  219. },
  220. onDetail(){
  221. // uni.redirectTo({
  222. // url:"/pages_subpack/order-detail/index?orderId="+this.id
  223. // })
  224. uni.navigateBack(-1)
  225. }
  226. }
  227. }
  228. </script>
  229. <style>
  230. page{
  231. background-color: #f5f5f5;
  232. }
  233. </style>