Selaa lähdekoodia

Merge branch 'dev' of https://git.citupro.com/zhengnaiwen_citu/menduner into dev

Xiao_123 4 kuukautta sitten
vanhempi
commit
f9cf6b3892

+ 8 - 0
src/api/position.js

@@ -218,6 +218,14 @@ export const refreshJobAdvertised = async (ids) => {
     openEncryption: true
   })
 }
+// // 招聘端-刷新职位
+// export const refreshJobAdvertised = async (ids) => {
+//   return await request.post({
+//     url: `/app-api/menduner/system/recruit/job-advertised/refresh?${encodeURIComponent('ids='+ids)}`,
+//     encodeParams: true,
+//     openEncryption: true
+//   })
+// }
 
 // 招聘端-开启职位
 export const enableJobAdvertised = async (ids) => {

+ 2 - 0
src/config/axios/service.js

@@ -106,6 +106,7 @@ service.interceptors.request.use(
     // 开启参数加密
     if (config.openEncryption) {
       const raw = config.url.split('?')[1]
+      // const raw = config.encodeParams ? config.url.split('?')[1] : config.url.split('?')[1]
       const body = {
         ...config.data,
         ...config.params
@@ -130,6 +131,7 @@ service.interceptors.request.use(
         content
       })
       Object.assign(config.headers, header)
+      // if (config.encodeParams) config.url = config.url.split('?')[0] + '?' + decodeURIComponent(config.url.split('?')[1])
     }
     
     if (isToken) {

+ 1 - 0
src/utils/index.js

@@ -110,6 +110,7 @@ export const saveAs = (blob, filename) => {
   link.click()
 }
 
+// 计算空格
 export const spaces = (num = 6) => {
   return '\xa0'.repeat(num)
 }

+ 1 - 0
src/utils/openEncryption.js

@@ -35,6 +35,7 @@ export const encryptionFun = ({raw, body, appId, AppSecret}) => {
     str += decodeURIComponent(JSON.stringify(body))
   }
   // console.log('str:', str, 'paramsStr:', paramsStr)
+  // console.log(sha256(str + paramsStr))
   return {
     ...initSign,
     sign: sha256(str + paramsStr)

+ 0 - 17
src/views/mall/components/details/comment.vue

@@ -1,17 +0,0 @@
-<!--  -->
-<template>
-  <div>商品评价</div>
-</template>
-
-<script setup>
-defineOptions({name: 'goods-details-comment'})
-const props = defineProps({
-  goodsId: {
-    type: String,
-    default: '',
-  },
-});
-console.log('content:', props.goodsId)
-</script>
-<style lang="scss" scoped>
-</style>

+ 3 - 51
src/views/mall/components/details/order/addressSelection.vue

@@ -1,20 +1,6 @@
 <!-- 下单界面,收货地址 or 自提门店的选择组件 -->
 <template>
-  <div class="allAddress" :style="state.isPickUp ? '' : 'padding-top:10rpx;'">
-    <!-- <div class="nav flex flex-wrap">
-      <div
-        class="item font-color"
-        :class="state.deliveryType === 1 ? 'on' : 'on2'"
-        @click="switchDeliveryType(1)"
-        v-if="state.isPickUp"
-      />
-      <div
-        class="item font-color"
-        :class="state.deliveryType === 2 ? 'on' : 'on2'"
-        @click="switchDeliveryType(2)"
-        v-if="state.isPickUp"
-      />
-    </div> -->
+  <v-card class="allAddress" elevation="1" :style="state.isPickUp ? '' : 'padding-top:10rpx;'">
     <!-- 情况一:收货地址的选择 -->
     <div
       class="address"
@@ -43,41 +29,13 @@
         </div>
       </div>
     </div>
-    <!-- 情况二:门店的选择 -->
-    <!-- <div
-      class="address flex flex-wrap flex-center ss-row-between"
-      v-if="state.deliveryType === 2"
-      @click="onSelectAddress"
-    >
-      <div class="addressCon" v-if="state.pickUpInfo.name">
-        <div class="name"
-          >{{ state.pickUpInfo.name }}
-          <div class="phone">{{ state.pickUpInfo.phone }}</div>
-        </div>
-        <div class="line1">
-          {{ state.pickUpInfo.areaName }}{{ ', ' + state.pickUpInfo.detailAddress }}
-        </div>
-      </div>
-      <div class="addressCon" v-else>
-        <div class="setaddress">选择自提门店</div>
-      </div>
-      <div class="iconfont">
-        <div class="ss-rest-button">
-          <div class="_icon-forward" />
-        </div>
-      </div>
-    </div> -->
-    <!-- <div class="line">
-      <image :src="sheep.$url.static('/static/images/line.png', 'local')" />
-    </div> -->
-  </div>
+  </v-card>
 </template>
 
 <script setup>
   import { computed } from 'vue';
-  // import sheep from '@/sheep';
   import { isEmpty1 } from '@/utils/is'
-  import Snackbar from '@/plugins/snackbar'
+  // import Snackbar from '@/plugins/snackbar'
 
   const props = defineProps({
     modelValue: {
@@ -164,7 +122,6 @@
     box-sizing: border-box;
     padding: 12px;
     border-radius: 10px;
-    background-color: var(--default-bgc);
   }
 
   .address .addressCon {
@@ -200,11 +157,6 @@
 
   .allAddress {
     width: 100%;
-    background: linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);
-    // background-image: linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);
-    // background-image: -webkit-linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);
-    // background-image: -moz-linear-gradient(to bottom, #e93323 0%, #f5f5f5 100%);
-    //padding: 100rpx 30rpx 0 30rpx;
     padding-top: 100rpx;
     padding-bottom: 10rpx;
   }

+ 27 - 173
src/views/mall/components/details/order/confirm.vue

@@ -1,174 +1,47 @@
 <template>
-  <div title="确认订单">
+  <div>
     <!-- 头部地址选择【配送地址】【自提地址】 -->
     <AddressSelection v-model="addressState" class="mb-3" />
-
-    <!-- 商品信息 -->
-    <!-- <div>
+    
+    <!-- 购买的商品信息 -->
+    <div class="goodsListBox mb-3">
       <s-goods-item
-        v-for="item in state.orderInfo.items"
+        v-for="(item, index) in state.orderInfo.items"
         :key="item.skuId"
         :img="item.picUrl"
         :title="item.spuName"
         :skuText="item.properties.map((property) => property.valueName).join(' ')"
         :price="item.price"
         :num="item.count"
-        marginBottom="10"
+        :marginTop="index ? '0' : '12'"
       />
-    </div> -->
+    </div>
 
     <!-- 价格信息 -->
     <div>
       <div>
         <div class="order-item d-flex">
-          <div class="item-title mr-3">商品金额:</div>
+          <div class="item-title mr-3 ">商品金额:</div>
           <div>
             <span class="item-value">
               ¥{{ fen2yuan(state.orderInfo.price.totalPrice) }}
             </span>
           </div>
         </div>
-        <!-- <div
-          v-if="state.orderPayload.pointActivityId"
-          class="order-item ss-flex ss-col-center ss-row-between"
-        >
-          <div class="item-title">兑换积分</div>
-          <div class="ss-flex ss-col-center">
-            <image
-              :src="sheep.$url.static('/static/img/shop/goods/score1.svg')"
-              class="score-img"
-            />
-            <span class="item-value ss-m-r-24">
-              {{ state.orderInfo.usePoint }}
-            </span>
-          </div>
-        </div>
-        <div
-          class="order-item ss-flex ss-col-center ss-row-between"
-          v-if="state.orderInfo.type === 0 || state.orderPayload.pointActivityId"
-        >
-          <div class="item-title">积分抵扣</div>
-          <div class="ss-flex ss-col-center">
-            {{ state.pointStatus || state.orderPayload.pointActivityId ? '剩余积分' : '当前积分' }}
-            <image
-              :src="sheep.$url.static('/static/img/shop/goods/score1.svg')"
-              class="score-img"
-            />
-            <span class="item-value ss-m-r-24">
-              {{
-                state.pointStatus || state.orderPayload.pointActivityId
-                  ? state.orderInfo.totalPoint - state.orderInfo.usePoint
-                  : state.orderInfo.totalPoint || 0
-              }}
-            </span>
-            <checkbox-group @change="changeIntegral" v-if="!state.orderPayload.pointActivityId">
-              <checkbox
-                :checked="state.pointStatus"
-                :disabled="!state.orderInfo.totalPoint || state.orderInfo.totalPoint <= 0"
-              />
-            </checkbox-group>
-          </div>
-        </div> -->
         <!-- 快递配置时,信息的展示 -->
         <div
           class="order-item d-flex"
           v-if="addressState.deliveryType === 1"
         >
-          <div class="item-title mr-3">运费:</div>
-          <div class="ss-flex ss-col-center">
-            <span class="item-value ss-m-r-24" v-if="state.orderInfo.price.deliveryPrice > 0">
+          <div class="item-title mr-3">运{{ spaces() }}费:</div>
+          <div>
+            <span class="item-value text-red" v-if="state.orderInfo.price.deliveryPrice > 0">
               +¥{{ fen2yuan(state.orderInfo.price.deliveryPrice) }}
             </span>
-            <div class="item-value ss-m-r-24" v-else>免运费</div>
+            <div class="item-value" v-else>免运费</div>
           </div>
         </div>
         <!-- 门店自提时,需要填写姓名和手机号 -->
-        <div
-          class="order-item ss-flex ss-col-center ss-row-between"
-          v-if="addressState.deliveryType === 2"
-        >
-          <div class="item-title">联系人</div>
-          <div class="ss-flex ss-col-center">
-            请填写您的联系姓名
-            <!-- <uni-easyinput
-              maxlength="20"
-              placeholder="请填写您的联系姓名"
-              v-model="addressState.receiverName"
-              :inputBorder="false"
-              :clearable="false"
-            /> -->
-          </div>
-        </div>
-        <div
-          class="order-item ss-flex ss-col-center ss-row-between"
-          v-if="addressState.deliveryType === 2"
-        >
-          <div class="item-title">联系电话</div>
-          <div class="ss-flex ss-col-center">
-            请填写您的联系电话
-            <!-- <uni-easyinput
-              maxlength="20"
-              placeholder="请填写您的联系电话"
-              v-model="addressState.receiverMobile"
-              :inputBorder="false"
-              :clearable="false"
-            /> -->
-          </div>
-        </div>
-        <!-- 优惠劵:只有 type = 0 普通订单(非拼团、秒杀、砍价),才可以使用优惠劵 -->
-        <!-- <div
-          class="order-item ss-flex ss-col-center ss-row-between"
-          v-if="state.orderInfo.type === 0"
-        >
-          <div class="item-title">优惠券</div>
-          <div class="ss-flex ss-col-center" @tap="state.showCoupon = true">
-            <span class="item-value text-red" v-if="state.orderPayload.couponId > 0">
-              -¥{{ fen2yuan(state.orderInfo.price.couponPrice) }}
-            </span>
-            <span
-              class="item-value"
-              :class="
-                state.couponInfo.filter((coupon) => coupon.match).length > 0
-                  ? 'text-red'
-                  : 'text-disabled'
-              "
-              v-else
-            >
-              {{
-                state.couponInfo.filter((coupon) => coupon.match).length > 0
-                  ? state.couponInfo.filter((coupon) => coupon.match).length + ' 张可用'
-                  : '暂无可用优惠券'
-              }}
-            </span>
-            <span class="_icon-forward item-icon" />
-          </div>
-        </div>
-        <div
-          class="order-item ss-flex ss-col-center ss-row-between"
-          v-if="state.orderInfo.price.discountPrice > 0"
-        >
-          <div class="item-title">活动优惠</div>
-          <div class="ss-flex ss-col-center" @tap="state.showDiscount = true">
-            <span class="item-value text-red">
-              -¥{{ fen2yuan(state.orderInfo.price.discountPrice) }}
-            </span>
-            <span class="_icon-forward item-icon" />
-          </div>
-        </div>
-        <div
-          class="order-item ss-flex ss-col-center ss-row-between"
-          v-if="state.orderInfo.price.vipPrice > 0"
-        >
-          <div class="item-title">会员优惠</div>
-          <div class="ss-flex ss-col-center">
-            <span class="item-value text-red">
-              -¥{{ fen2yuan(state.orderInfo.price.vipPrice) }}
-            </span>
-          </div>
-        </div> -->
-      </div>
-      <div class="total-num ss-m-r-20">
-        共{{ state.orderInfo.items.reduce((acc, item) => acc + item.count, 0) }}件
       </div>
       
       <div class="mt-5">
@@ -184,50 +57,25 @@
 
       <div class="total-box-footer d-flex flex-column align-end">
         <div class="d-flex">
+          <div class="mr-3">
+            <span class="total-num">共</span>
+            <span class="mx-1" style="color: var(--v-primary-base);">{{ state.orderInfo.items.reduce((acc, item) => acc + item.count, 0) }}</span>
+            <span class="total-num">件</span>
+          </div>
           <div>合计:</div>
           <div class="total-num text-red"> ¥{{ fen2yuan(state.orderInfo.price.payPrice) }}</div>
         </div>
       </div>
     </div>
-
-    <!-- 选择优惠券弹框 -->
-    <!-- <s-coupon-select
-      v-model="state.couponInfo"
-      :show="state.showCoupon"
-      @confirm="onSelectCoupon"
-      @close="state.showCoupon = false"
-    /> -->
-
-    <!-- 满额折扣弹框 TODO @puhui999:【折扣】后续要把优惠信息打进去 -->
-    <!-- <s-discount-list
-      v-model="state.orderInfo"
-      :show="state.showDiscount"
-      @close="state.showDiscount = false"
-    /> -->
-
-    <!-- 底部 -->
-    <!-- <su-fixed bottom :opacity="false" bg="bg-white" placeholder :noFixed="false" :index="200">
-      <div class="footer-box border-top ss-flex ss-row-between ss-p-x-20 ss-col-center">
-        <div class="total-box-footer ss-flex ss-col-center">
-          <div class="total-num ss-font-30 text-red">
-            ¥{{ fen2yuan(state.orderInfo.price.payPrice) }}
-          </div>
-        </div>
-        <button
-          class="ss-reset-button ui-BG-Main-Gradient ss-r-40 submit-btn ui-Shadow-Main"
-          @tap="onConfirm"
-        >
-          提交订单
-        </button>
-      </div>
-    </su-fixed> -->
   </div>
 </template>
 
 <script setup>
   import { reactive, ref, watch } from 'vue'
   import AddressSelection from './addressSelection.vue'
+  import sGoodsItem from '@/views/mall/components/s-goods-item'
   import { fen2yuan } from '@/hooks/web/useGoods'
+  import { spaces } from '@/utils/index.js'
   import { getTradeConfig, createOrder, settlementOrder } from '@/api/mall/trade'
   import Snackbar from '@/plugins/snackbar'
   import { getOrderPayStatus, payOrderSubmit } from '@/api/common'
@@ -479,6 +327,10 @@
 </script>
 
 <style lang="scss" scoped>
+  .goodsListBox {
+    background: linear-gradient(to bottom, #e93323 0%, #e93323 100%);
+    // background: linear-gradient(to bottom, var(--v-primary-base) 0%, var(--v-primary-base) 100%);
+  }
   .score-img {
     width: 36rpx;
     height: 36rpx;
@@ -491,15 +343,17 @@
     .item-title {
       font-size: 28rpx;
       font-weight: 400;
+      color: #7a7a7a;
     }
 
     .item-value {
       font-size: 28rpx;
       font-weight: 500;
+      color: #7a7a7a;
     }
 
     .text-disabled {
-      color: #bbbbbb;
+      color: #070606;
     }
 
     .item-icon {
@@ -521,7 +375,7 @@
     height: 90rpx;
 
     .total-num {
-      color: #333333;
+      color: #7a7a7a;
     }
   }
 

+ 109 - 0
src/views/mall/components/s-goods-item/index.vue

@@ -0,0 +1,109 @@
+<template>
+  <div class="box">
+    <div
+      class="d-flex"
+      :style="[{ borderRadius: radius + 'px', marginTop: marginTop + 'px' }]"
+    >
+      <div style="width: 80px; height: 80px;" class="mr-3">
+        <v-img :src="img" :aspect-ratio="1" style="border-radius: 8px;"></v-img>
+      </div>
+      <div
+        class="d-flex flex-column justify-space-between"
+        style="flex: 1; font-size: 13px;"
+        :style="[{ width: titleWidth ? titleWidth + 'px' : '' }]"
+      >
+        <div v-if="title">{{ title }}</div>
+        <div v-if="skuString" style="color: var(--v-primary-base);">{{ skuString }}</div>
+        <div class="d-flex">
+          <div
+            :style="[{ color: priceColor }]"
+            v-if="price && Number(price) > 0"
+          >
+            ¥{{ fen2yuan(price) }}
+          </div>
+          <div v-if="point && Number(price) > 0">+</div>
+          <div v-if="num" class="buyNum ml-2"> x {{ num }}</div>
+        </div>
+      </div>
+    </div>
+  </div>
+</template>
+
+<script setup>
+  import { computed } from 'vue';
+  import { fen2yuan } from '@/hooks/web/useGoods'
+  /**
+   * 订单卡片
+   *
+   * @property {String} img 											- 图片
+   * @property {String} title 										- 标题
+   * @property {Number} titleWidth = 0								- 标题宽度,默认0,单位rpx
+   * @property {String} skuText 										- 规格
+   * @property {String | Number} price 								- 价格
+   * @property {String} priceColor 									- 价格颜色
+   * @property {Number | String} num									- 数量
+   *
+   */
+  const props = defineProps({
+    img: {
+      type: String,
+      default: 'https://img1.baidu.com/it/u=1601695551,235775011&fm=26&fmt=auto',
+    },
+    title: {
+      type: String,
+      default: '',
+    },
+    titleWidth: {
+      type: Number,
+      default: 0,
+    },
+    skuText: {
+      type: [String, Array],
+      default: '',
+    },
+    price: {
+      type: [String, Number],
+      default: '',
+    },
+    priceColor: {
+      type: [String],
+      default: '',
+    },
+    num: {
+      type: [String, Number],
+      default: 0,
+    },
+    point: {
+      type: [String, Number],
+      default: '',
+    },
+    radius: {
+      type: [String],
+      default: '',
+    },
+    marginTop: {
+      type: [String],
+      default: '',
+    },
+  });
+  const skuString = computed(() => {
+    if (!props.skuText) {
+      return '';
+    }
+    if (typeof props.skuText === 'object') {
+      return props.skuText.join(',');
+    }
+    return props.skuText;
+  });
+</script>
+
+<style lang="scss" scoped>
+.box {
+  background-color: var(--default-bgc);
+  border-radius: 8px;
+  padding: 12px;
+}
+.buyNum {
+  color: #777;
+}
+</style>