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

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