master
2022-12-27 14:49:23 +08:00
parent 5e38247ce8
commit 18251dde89
3 changed files with 590 additions and 687 deletions

View File

@ -64,4 +64,11 @@ export function getTalk(talkId) {
params params
}); });
} }
// 从商品页点击 客服 跳转 获取聊天记录
export function jumpObtain(skuId, goodsId) {
return http.request({
url: `${api.im}/goods/goods/sku/${goodsId}/${skuId}`,
method: Method.GET,
});
}

View File

@ -37,8 +37,7 @@
<!-- 接收人消息 --> <!-- 接收人消息 -->
<view v-else class="flex-row-start margin-left margin-top one-show"> <view v-else class="flex-row-start margin-left margin-top one-show">
<view class="chat-img flex-row-center"> <view class="chat-img flex-row-center">
<u-avatar :src="toUser.face" :text="toUser.face ? '' : toUser.name" <u-avatar :src="toUser.face" :text="toUser.face ? '' : toUser.name" bg-color="#DDDDDD"></u-avatar>
bg-color="#DDDDDD"></u-avatar>
<!-- <u-image style="height: 100rpx;width: 100rpx;" shape="circle" <!-- <u-image style="height: 100rpx;width: 100rpx;" shape="circle"
:src="toUser.face || 'https://avatars.dicebear.com/api/initials/' + toUser.name + '.svg?fontSize=38'" :src="toUser.face || 'https://avatars.dicebear.com/api/initials/' + toUser.name + '.svg?fontSize=38'"
mode="aspectFit"></u-image> --> mode="aspectFit"></u-image> -->
@ -46,8 +45,7 @@
<view class="flex" style="width: 500rpx;"> <view class="flex" style="width: 500rpx;">
<view> <view>
<view class="other-name">{{ toUser.name }}</view> <view class="other-name">{{ toUser.name }}</view>
<view class="margin-left padding-chat flex-column-start bg-to-color" <view class="margin-left padding-chat flex-column-start bg-to-color" style="border-radius: 35rpx;">
style="border-radius: 35rpx;">
<text style="word-break: break-all;">{{ item.text }}</text> <text style="word-break: break-all;">{{ item.text }}</text>
</view> </view>
</view> </view>
@ -106,7 +104,7 @@ var l
var wh var wh
// //
var mgUpHeight var mgUpHeight
import { getTalkMessage, getTalkByUser } from "@/api/im.js"; import { getTalkMessage, getTalkByUser, jumpObtain } from "@/api/im.js";
import SocketService from "@/utils/socket_service.js"; import SocketService from "@/utils/socket_service.js";
import storage from "@/utils/storage.js"; import storage from "@/utils/storage.js";
import { beautifyTime } from "@/utils/filters.js" import { beautifyTime } from "@/utils/filters.js"

View File

@ -6,55 +6,27 @@
<!-- 仅h5有效 打开App --> <!-- 仅h5有效 打开App -->
<!-- 分享 --> <!-- 分享 -->
<shares <shares v-if="enableShare && goodsDetail.id" :skuId="this.routerVal.id" :goodsId="this.routerVal.goodsId" :link="
v-if="enableShare && goodsDetail.id"
:skuId="this.routerVal.id"
:goodsId="this.routerVal.goodsId"
:link="
'/pages/product/goods?id=' + '/pages/product/goods?id=' +
this.routerVal.id + this.routerVal.id +
'&goodsId=' + '&goodsId=' +
this.routerVal.goodsId this.routerVal.goodsId
" " :thumbnail="goodsDetail.thumbnail" :goodsName="goodsDetail.goodsName" type="goods" @close="enableShare = false" />
:thumbnail="goodsDetail.thumbnail" <popups v-model="popupsSwitch" @tapPopup="handleNavbarList" :popData="navbarListData" :x="navbarListX"
:goodsName="goodsDetail.goodsName" :y="navbarListY" placement="top-start" />
type="goods"
@close="enableShare = false"
/>
<popups
v-model="popupsSwitch"
@tapPopup="handleNavbarList"
:popData="navbarListData"
:x="navbarListX"
:y="navbarListY"
placement="top-start"
/>
<view class="index"> <view class="index">
<!-- topBar --> <!-- topBar -->
<u-navbar <u-navbar :background="navbar" :is-back="false" :class="headerFlag ? 'header' : 'header bg-none scroll-hide'">
:background="navbar"
:is-back="false"
:class="headerFlag ? 'header' : 'header bg-none scroll-hide'"
>
<div class="headerRow"> <div class="headerRow">
<div class="backs"> <div class="backs">
<u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon> <u-icon @click="back()" name="arrow-left" class="icon-back"></u-icon>
<u-icon <u-icon name="list" @click="popupsSwitch = !popupsSwitch" class="icon-list"></u-icon>
name="list"
@click="popupsSwitch = !popupsSwitch"
class="icon-list"
></u-icon>
</div> </div>
<div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'"> <div class="headerList" :class="headerFlag ? 'tab-bar' : 'tab-bar scroll-hide'">
<div class="headerRow"> <div class="headerRow">
<div <div class="nav-item" v-for="header in headerList" :key="header.id"
class="nav-item" :class="{ cur: scrollId === header.id }" @click="headerTab(header.id)">
v-for="header in headerList"
:key="header.id"
:class="{ cur: scrollId === header.id }"
@click="headerTab(header.id)"
>
{{ header.text }} {{ header.text }}
</div> </div>
</div> </div>
@ -62,57 +34,26 @@
</div> </div>
</u-navbar> </u-navbar>
<u-navbar <u-navbar :border-bottom="false" v-show="!headerFlag" class="header-only-back" :background="navbarOnlyBack"
:border-bottom="false" :is-back="false">
v-show="!headerFlag"
class="header-only-back"
:background="navbarOnlyBack"
:is-back="false"
>
<div> <div>
<div class="bg-back"> <div class="bg-back">
<u-icon <u-icon size="40" @click="back()" name="arrow-left" class="icon-back"></u-icon>
size="40" <u-icon size="40" @click="popupsSwitch = !popupsSwitch" name="list" class="icon-list"></u-icon>
@click="back()"
name="arrow-left"
class="icon-back"
></u-icon>
<u-icon
size="40"
@click="popupsSwitch = !popupsSwitch"
name="list"
class="icon-list"
></u-icon>
</div> </div>
</div> </div>
</u-navbar> </u-navbar>
</view> </view>
<view <view class="product-container" :style="{ height: productRefHeight }" ref="productRef" id="productRef">
class="product-container" <scroll-view scroll-anchoring enableBackToTop="true" scroll-with-animation scroll-y class="scroll-page"
:style="{ height: productRefHeight }" :scroll-top="tabScrollTop" @scroll="pageScroll">
ref="productRef"
id="productRef"
>
<scroll-view
scroll-anchoring
enableBackToTop="true"
scroll-with-animation
scroll-y
class="scroll-page"
:scroll-top="tabScrollTop"
@scroll="pageScroll"
>
<view> <view>
<!-- 轮播图 --> <!-- 轮播图 -->
<GoodsSwiper id="main1" :res="imgList" /> <GoodsSwiper id="main1" :res="imgList" />
<!-- 促销活动条 --> <!-- 促销活动条 -->
<PromotionAssembleLayout <PromotionAssembleLayout v-if="PromotionList" :detail="goodsDetail" :res="PromotionList" />
v-if="PromotionList"
:detail="goodsDetail"
:res="PromotionList"
/>
<view class="card-box top-radius-0" id="main2"> <view class="card-box top-radius-0" id="main2">
<!-- 活动不显示价钱 --> <!-- 活动不显示价钱 -->
@ -122,11 +63,7 @@
{{ goodsDetail.goodsName || "" }} {{ goodsDetail.goodsName || "" }}
</view> </view>
<view class="favorite" @click="clickFavorite(goodsDetail.id)"> <view class="favorite" @click="clickFavorite(goodsDetail.id)">
<u-icon <u-icon size="30" :color="favorite ? '#f2270c' : '#262626'" :name="favorite ? 'heart-fill' : 'heart'">
size="30"
:color="favorite ? '#f2270c' : '#262626'"
:name="favorite ? 'heart-fill' : 'heart'"
>
</u-icon> </u-icon>
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ <view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
favorite ? "已收藏" : "收藏" favorite ? "已收藏" : "收藏"
@ -147,12 +84,21 @@
<span> <span>
<span v-if="wholesaleList.length"> <span v-if="wholesaleList.length">
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length-1].price)[1] }} <span>¥</span><span class="price">{{
$options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[0]
}}</span>.{{
$options.filters.goodsFormatPrice(wholesaleList[wholesaleList.length - 1].price)[1]
}}
~ ~
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(wholesaleList[0].price)[1] }} <span>¥</span><span class="price">{{
$options.filters.goodsFormatPrice(wholesaleList[0].price)[0]
}}</span>.{{
$options.filters.goodsFormatPrice(wholesaleList[0].price)[1]
}}
</span> </span>
<span v-else> <span v-else>
<span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0] }}</span>.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }} <span>¥</span><span class="price">{{ $options.filters.goodsFormatPrice(goodsDetail.price)[0]
}}</span>.{{ $options.filters.goodsFormatPrice(goodsDetail.price)[1] }}
</span> </span>
</span> </span>
</view> </view>
@ -165,11 +111,8 @@
<view>分享</view> <view>分享</view>
</view> </view>
<view class="icons" @click="clickFavorite(goodsDetail.id)"> <view class="icons" @click="clickFavorite(goodsDetail.id)">
<u-icon <u-icon size="30" :color="favorite ? '#f2270c' : '#262626'"
size="30" :name="favorite ? 'heart-fill' : 'heart'"></u-icon>
:color="favorite ? '#f2270c' : '#262626'"
:name="favorite ? 'heart-fill' : 'heart'"
></u-icon>
<view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{ <view :style="{ color: favorite ? '#f2270c' : '#262626' }">{{
favorite ? "已收藏" : "收藏" favorite ? "已收藏" : "收藏"
}}</view> }}</view>
@ -199,22 +142,16 @@
</view> </view>
<!-- 拼团用户列表 --> <!-- 拼团用户列表 -->
<PromotionAssembleListLayout <PromotionAssembleListLayout v-if="isGroup" @to-assemble-buy-now="toAssembleBuyNow" :res="PromotionList" />
v-if="isGroup"
@to-assemble-buy-now="toAssembleBuyNow"
:res="PromotionList"
/>
<!-- 配置地址 如果是虚拟产品的时候不展示 --> <!-- 配置地址 如果是虚拟产品的时候不展示 -->
<view class="card-box" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'"> <view class="card-box" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'">
<view class="card-flex" @click="shutMask(4)"> <view class="card-flex" @click="shutMask(4)">
<view class="card-title"> 已选 </view> <view class="card-title"> 已选 </view>
<view class="card-content"> <view class="card-content">
<span v-if="selectedGoods.spec" <span v-if="selectedGoods.spec">{{ selectedGoods.spec.specName }}-{{
>{{ selectedGoods.spec.specName }}-{{
selectedGoods.spec.specValue selectedGoods.spec.specValue
}}</span }}</span>
>
<span v-else></span> <span v-else></span>
</view> </view>
<view class="card-bottom"> <view class="card-bottom">
@ -239,21 +176,11 @@
<Evaluation id="main5" :goodsDetail="goodsDetail" /> <Evaluation id="main5" :goodsDetail="goodsDetail" />
<!-- 店铺推荐 --> <!-- 店铺推荐 -->
<storeLayout <storeLayout id="main7" :storeDetail="storeDetail" :goodsDetail="goodsDetail" :res="recommendList" />
id="main7"
:storeDetail="storeDetail"
:goodsDetail="goodsDetail"
:res="recommendList"
/>
<!-- 宝贝详情 --> <!-- 宝贝详情 -->
<GoodsIntro <GoodsIntro id="main9" :res="goodsDetail" :goodsParams="goodsParams" :goodsId="goodsDetail.goodsId"
id="main9" v-if="goodsDetail.id" />
:res="goodsDetail"
:goodsParams="goodsParams"
:goodsId="goodsDetail.goodsId"
v-if="goodsDetail.id"
/>
<!-- 宝贝推荐 --> <!-- 宝贝推荐 -->
<GoodsRecommend id="main11" :res="likeGoodsList" /> <GoodsRecommend id="main11" :res="likeGoodsList" />
@ -278,13 +205,8 @@
</view> </view>
<!-- 正常结算页面 --> <!-- 正常结算页面 -->
<view class="detail-btn" v-if="!isGroup"> <view class="detail-btn" v-if="!isGroup">
<view <view class="to-store-car to-store-btn" v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'" @click="shutMask(4)">
class="to-store-car to-store-btn" 加入购物车</view>
v-if="goodsDetail.goodsType != 'VIRTUAL_GOODS'"
@click="shutMask(4)"
>
加入购物车</view
>
<view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view> <view class="to-buy to-store-btn" @click="shutMask(4, 'buy')">立即购买</view>
<view class="to-store-car to-store-btn" v-if="startTimer"></view> <view class="to-store-car to-store-btn" v-if="startTimer"></view>
</view> </view>
@ -303,15 +225,8 @@
<!-- 规格-模态层弹窗 --> <!-- 规格-模态层弹窗 -->
<view class="spec"> <view class="spec">
<!-- 促销弹窗 --> <!-- 促销弹窗 -->
<u-popup <u-popup v-model="promotionShow" :height="setup.height" :mode="setup.mode" :border-radius="setup.radius"
v-model="promotionShow" @close="promotionShow = false" :mask-close-able="setup.close" closeable>
:height="setup.height"
:mode="setup.mode"
:border-radius="setup.radius"
@close="promotionShow = false"
:mask-close-able="setup.close"
closeable
>
<view class="header-title">优惠</view> <view class="header-title">优惠</view>
<view class="cuxiao"> <view class="cuxiao">
<scroll-view class="scroll_mask" :scroll-y="true"> <scroll-view class="scroll_mask" :scroll-y="true">
@ -328,31 +243,14 @@
</u-popup> </u-popup>
<!-- 配送地址弹窗 --> <!-- 配送地址弹窗 -->
<popupAddress <popupAddress @closeAddress="closePopupAddress" @deliveryData="deliveryFun" v-if="goodsDetail.id"
@closeAddress="closePopupAddress" :goodsId="goodsDetail.id" :addressFlag="addressFlag" />
@deliveryData="deliveryFun"
v-if="goodsDetail.id"
:goodsId="goodsDetail.id"
:addressFlag="addressFlag"
/>
<!-- 商品规格 商品详情以及默认参与活动的id--> <!-- 商品规格 商品详情以及默认参与活动的id-->
<popupGoods <popupGoods :addr="delivery" ref="popupGoods" @changed="changedGoods" @closeBuy="closePopupBuy"
:addr="delivery" @queryCart="cartCount()" :goodsDetail="goodsDetail" :goodsSpec="goodsSpec" :isGroup="isGroup" :id="productId"
ref="popupGoods" v-if="goodsDetail.id" :pointDetail="pointDetail" :wholesaleList="wholesaleList" @handleClickSku="selectSku"
@changed="changedGoods" :buyMask="buyMask" />
@closeBuy="closePopupBuy"
@queryCart="cartCount()"
:goodsDetail="goodsDetail"
:goodsSpec="goodsSpec"
:isGroup="isGroup"
:id="productId"
v-if="goodsDetail.id"
:pointDetail="pointDetail"
:wholesaleList="wholesaleList"
@handleClickSku="selectSku"
:buyMask="buyMask"
/>
</view> </view>
</view> </view>
</div> </div>
@ -704,7 +602,7 @@ export default {
// lili // lili
uni.navigateTo({ uni.navigateTo({
url: `/pages/mine/im/index?userId=`+this.goodsDetail.storeId, url: `/pages/mine/im/index?userId=${this.goodsDetail.storeId}&goodsid=${this.routerVal.goodsId}&skuid=${this.routerVal.id}`
}); });
// udesk // udesk