ext.liuqiwen3 1 päivä sitten
vanhempi
commit
cc7f4c1e69

+ 20 - 4
components/orderGoods/index.vue

@@ -3,11 +3,14 @@
 <!--    <view class="total"-->
 <!--      >共{{ orderProNum ? orderProNum : totalNmu }}件商品</view-->
 <!--    >-->
-    <view class="total"  @click="toMerchant(sbMerchant.id)"
+    <view class="total"
     >
-      <image class="merchantImg" :src="sbMerchant.merchantLogo"></image>
-      <text style="margin-left: 10rpx;">{{sbMerchant.merchantName}}</text>
-      <uni-icons style="margin-left: 10rpx;" type="right" size="16" color="#999999"></uni-icons>
+      <view v-if="sbMerchant&&sbMerchant.merchantName" class="merchant-container" @click.stop="toMerchant(sbMerchant.id)">
+        <image v-if="sbMerchant.merchantLogo" class="merchant-logo" :src="sbMerchant.merchantLogo" mode=""></image>
+        <text class="merchant-name">{{sbMerchant.merchantName}}</text>
+        <uni-icons type="right" size="16" color="#333"></uni-icons>
+      </view>
+      <text>共{{ orderProNum ? orderProNum : totalNmu }}件商品</text>
     </view>
     <view class="goodWrapper pad30">
       <view
@@ -144,4 +147,17 @@ const toMerchant = (merchantId) => {
   height: 60rpx;
   border-radius: 50%;
 }
+.merchant-container{
+  display: flex;
+  justify-content: flex-start;
+  align-items: center;
+  color:#333;
+  .merchant-logo{
+    width: 40rpx;
+    height: 40rpx;
+    margin-right: 20rpx;
+    border-radius: 50%;
+    background-color: #000;
+  }
+}
 </style>

+ 1 - 1
pages/change_password/change_password.vue

@@ -48,7 +48,7 @@
                 style="width: 28rpx; height: 32rpx"
               ></image>
               <input
-                type="safe-password"
+                  :password="true"
                 class="texts"
                 placeholder="填写新密码"
                 v-model="password"

+ 30 - 4
pages/goods/goods_details/index.vue

@@ -401,6 +401,29 @@
       </view>
     </view>
     <view class="mask" v-if="posters" @click="closePosters"></view>
+    <view class="mask" v-if="canvasStatus"></view>
+    <!-- #ifdef MP -->
+    <!-- <authorize @onLoadFun="onLoadFun" :isAuto="isAuto" :isShowAuth="isShowAuth" @authColse="authColse"></authorize> -->
+    <!-- #endif -->
+    <!-- 海报展示 -->
+    <view class='poster-pop' v-if="canvasStatus">
+      <image src='@/static/images/poster-close.png' class='close' @click="posterImageClose"></image>
+      <image :src='imagePath'></image>
+      <!-- #ifndef H5  -->
+      <view class='save-poster' @click="savePosterPath">保存到手机</view>
+      <!-- #endif -->
+      <!-- #ifdef H5 -->
+      <view class="keep">长按图片可以保存到手机</view>
+      <!-- #endif -->
+    </view>
+    <view class="canvas" v-else>
+      <canvas style="width:750px;height:1190px;" canvas-id="firstCanvas"></canvas>
+      <canvas canvas-id="qrcode" :style="{width: `${qrcodeSize}px`, height: `${qrcodeSize}px`}" />
+    </view>
+    <!-- 发送给朋友图片 -->
+    <view class="share-box" v-if="H5ShareBox">
+      <image src="/static/images/share-info.png" @click="H5ShareBox = false"></image>
+    </view>
   </view>
 </template>
 
@@ -411,7 +434,7 @@ import { useToast } from "@/hooks/useToast";
 import { useAppStore } from "@/stores/app.js";
 // import uQRCode from '@/js_sdk/Sansnn-uQRCode/uqrcode.js';
 import UQRCode from "uqrcodejs";
-import { getProductDetail, postCartAdd,collectDel,collectAdd } from "@/api/store.js";
+import { getProductDetail, postCartAdd,collectDel,collectAdd,getProductCode } from "@/api/store.js";
 import { spread } from "@/api/user";
 import { getCoupons, getQrcode } from "@/api/api.js";
 import { getCartCounts } from "@/api/order.js";
@@ -427,6 +450,9 @@ import $util from "@/utils/util.js";
 import { HTTP_REQUEST_URL_SHARE } from "@/config/app.js";
 import UniIcons from "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
 const { Toast } = useToast();
+import {
+  base64src
+} from '@/utils/base64src.js'
 
 const app = getApp();
 const instance = getCurrentInstance();
@@ -477,6 +503,7 @@ const lock = ref(false);
 const scrollTop = ref(0);
 const sliderImage = ref([]);
 const canvasStatus = ref(false);
+const qrcodeSize = ref(600);
 const imagePath = ref("");
 const imgTop = ref("");
 const errT = ref("");
@@ -488,6 +515,7 @@ const showProductPopup = ref(false); // 商品规格弹窗
 const showCouponPopup = ref(false); // 优惠券弹窗
 const handleBtnTpe = ref(""); // "buy" or "cart"
 const sbMerchantInfo = ref({});
+const H5ShareBox = false;
 
 watch(
   isLogin,
@@ -1047,8 +1075,6 @@ const goPoster = async () => {
     mask: true,
   });
   posters.value = false;
-  console.log('PromotionCode.value',PromotionCode.value)
-  console.log('imgTop.value',imgTop.value)
   if (!PromotionCode.value) {
     uni.hideLoading();
     Toast({
@@ -1077,7 +1103,7 @@ const goPoster = async () => {
       PromotionCode.value,
     ];
     const storeName = productInfo.value.storeName;
-    const price = productInfo.value.storePrice;
+    const price = attr.value.productSelect.storePrice;
     setTimeout(() => {
       $util.PosterCanvas(
         arrImages,

+ 8 - 3
pages/order_addcart/order_addcart.vue

@@ -35,7 +35,7 @@
                   <view class="merchant-info acea-row row-middle">
                     <image class="merchant-logo" :src="merchant.logo" mode="aspectFill"></image>
                     <text class="merchant-name">{{ merchant.name }}</text>
-                    <uni-icons type="right" size="14" color="#333333"></uni-icons>
+                    <uni-icons type="right" size="14" color="#333333" v-if="merchant.id != 'default'"></uni-icons>
                   </view>
                 </view>
 
@@ -495,7 +495,7 @@ const groupedCartList = computed(() => {
       if (!groups[defaultId]) {
         groups[defaultId] = {
           id: defaultId,
-          name: '其他商家',
+          name: '自营',
           logo: '/static/avator.png',
           products: []
         };
@@ -1223,7 +1223,12 @@ function unsetCart() {
     .catch((res) => {});
 }
 const toMerchant = (obj) => {
-  uni.navigateTo({ url:"/pages/merchantCenters/merchant?merchantId="+obj.id });
+  if(obj.id == 'default'){
+    return;
+  }else{
+    uni.navigateTo({ url:"/pages/merchantCenters/merchant?merchantId="+obj.id });
+  }
+
 }
 </script>
 

+ 3 - 3
pages/users/order_confirm/index.vue

@@ -43,7 +43,7 @@
           <view class="addressCon" v-else>
             <view class="setaddress">设置收货地址</view>
           </view>
-          <view class="iconfont icon-jiantou"></view>
+          <uni-icons type="right" size="14" color="#333333"></uni-icons>
         </view>
         <view
             class="address acea-row row-between-wrapper"
@@ -61,7 +61,7 @@
                 }}{{ ", " + system_store.detailedAddress }}
               </view>
             </view>
-            <view class="iconfont icon-jiantou"></view>
+            <uni-icons type="right" size="14" color="#333333"></uni-icons>
           </block>
           <block v-else>
             <view>暂无门店信息</view>
@@ -86,7 +86,7 @@
             <view>优惠券</view>
             <view class="discount"
             >{{ couponTitle }}
-              <text class="iconfont icon-jiantou"></text>
+              <uni-icons type="right" size="14" color="#333333"></uni-icons>
             </view>
           </view>
           <view class="item acea-row row-between-wrapper">

BIN
static/images/poster-close.png


BIN
static/images/posterbackgd.png


+ 23 - 0
utils/base64src.js

@@ -0,0 +1,23 @@
+const fsm = wx.getFileSystemManager ? wx.getFileSystemManager() : null;
+const FILE_BASE_NAME = 'tmp_base64src'; //自定义文件名
+
+export function base64src(base64data, cb) {
+  const [, format, bodyData] = /data:image\/(\w+);base64,(.*)/.exec(base64data) || [];
+  if (!format) {
+    return (new Error('ERROR_BASE64SRC_PARSE'));
+  }
+  const filePath = `${wx.env.USER_DATA_PATH}/${FILE_BASE_NAME}.${format}`;
+  const buffer = wx.base64ToArrayBuffer(bodyData);
+  fsm.writeFile({
+    filePath,
+    data: buffer,
+    encoding: 'binary',
+    success() {
+      cb(filePath);
+    },
+    fail() {
+      return (new Error('ERROR_BASE64SRC_WRITE'));
+    },
+  });
+};
+//module.exports = base64src;

+ 35 - 35
utils/util.js

@@ -129,41 +129,41 @@ export default {
         ctx.setFillStyle("#DA4F2A");
         ctx.fillText("¥" + price, 40, 820 + contentHh);
 
-        ctx.setTextAlign("left");
-        ctx.setFontSize(36);
-        ctx.setFillStyle("#999");
-        ctx.fillText("¥" + ot_price, 50, 876 + contentHh);
-
-        var underline = function (
-          ctx,
-          text,
-          x,
-          y,
-          size,
-          color,
-          thickness,
-          offset
-        ) {
-          var width = ctx.measureText(text).width;
-          switch (ctx.textAlign) {
-            case "center":
-              x -= width / 2;
-              break;
-            case "right":
-              x -= width;
-              break;
-          }
-
-          y += size + offset;
-
-          ctx.beginPath();
-          ctx.strokeStyle = color;
-          ctx.lineWidth = thickness;
-          ctx.moveTo(x, y);
-          ctx.lineTo(x + width, y);
-          ctx.stroke();
-        };
-        underline(ctx, "¥" + ot_price, 55, 865, 36, "#999", 2, 0);
+        // ctx.setTextAlign("left");
+        // ctx.setFontSize(36);
+        // ctx.setFillStyle("#999");
+        // ctx.fillText("¥" + ot_price, 50, 876 + contentHh);
+
+        // var underline = function (
+        //   ctx,
+        //   text,
+        //   x,
+        //   y,
+        //   size,
+        //   color,
+        //   thickness,
+        //   offset
+        // ) {
+        //   var width = ctx.measureText(text).width;
+        //   switch (ctx.textAlign) {
+        //     case "center":
+        //       x -= width / 2;
+        //       break;
+        //     case "right":
+        //       x -= width;
+        //       break;
+        //   }
+        //
+        //   y += size + offset;
+        //
+        //   ctx.beginPath();
+        //   ctx.strokeStyle = color;
+        //   ctx.lineWidth = thickness;
+        //   ctx.moveTo(x, y);
+        //   ctx.lineTo(x + width, y);
+        //   ctx.stroke();
+        // };
+        // underline(ctx, "¥" + ot_price, 55, 865, 36, "#999", 2, 0);
         ctx.setTextAlign("left");
         ctx.setFontSize(28);
         ctx.setFillStyle("#999");