Commit 13da40db by 匡雅琴

修改组件

1 parent 9dab5509
......@@ -32,7 +32,8 @@
"phone-number": "components/PhoneNumber/PhoneNumber",
"navigation-bar": "/components/NavigationBar/NavigationBar",
"glsx-image": "/components/image/index",
"loadding": "/components/loadding/loadding"
"loadding": "/components/loadding/loadding",
"no-product": "/components/NoProduct/index"
},
"resolveAlias": {
"~/*": "/*"
......
// components/NoProduct/index.js
Component({
/**
* 组件的属性列表
*/
properties: {
},
/**
* 组件的初始数据
*/
data: {
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
img_version: 'v1.0.0'
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* components/NoProduct/index.wxss */
.no-product {
height: 100vh;
font-weight: 500;
font-size: 48rpx;
color: #2D2D33;
text-align: center;
margin-top: 340rpx;
&-img {
width: 434rpx;
height: 276rpx;
margin-bottom: 50rpx;
}
}
\ No newline at end of file
<!--components/NoProduct/index.wxml-->
<view class="no-product">
<image class="no-product-img" src="{{IMG_URL}}index/productImgs/no-product.png?v={{img_version}}" />
<view>产品已下架</view>
</view>
......@@ -32,8 +32,8 @@
align-items: center;
}
.company-logo{
width: 296rpx;
height: 60rpx;
width: 172rpx;
height: 48rpx;
}
.user-company text {
font-size: 18rpx;
......
......@@ -140,9 +140,10 @@ Component({
},
// 长按图片
handleLongPress(e) {
console.log(e);
let {item} = e.currentTarget.dataset
// 如果图片有长按事件 posterEventType: 1-无 2-有
if (item.posterEventType == 1) return
let {item} = e.currentTarget.dataset
wx.downloadFile({
url: item.posterEventUrl,
success: function (res) {
......
......@@ -10,9 +10,9 @@
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
},
"glsx-applet-component": {
"version": "1.1.9",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.9.tgz",
"integrity": "sha512-8bVPzgXafaAc+kWUjuT0i+kLxCm/2VFxzN4ZqK5ZbRDxdbCKBNAmXjHYcMwN1Eg9Fli4ZqL7mIHsGCbyZU9doQ=="
"version": "1.1.10",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.10.tgz",
"integrity": "sha512-0jJ1RT28em/lU4sak53LlU8hNgVWpgqDtF+2XxFMxlD8lT8jopA2zrEARJArRvjp0SNyxe58UXAdhJ/a8R/KdA=="
}
}
}
......@@ -5,7 +5,7 @@
"main": "app.js",
"dependencies": {
"@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.1.9"
"glsx-applet-component": "^1.1.10"
},
"devDependencies": {},
"scripts": {
......
......@@ -57,6 +57,7 @@ Page({
trackData.EXPANGOLD,
],
isLoadding: true,
hasProduct: true
},
// 计算属性
computed: {
......@@ -80,9 +81,17 @@ Page({
//接受跳转的路由参数(小程序页面跳转)
async onRoute(options) {
console.log(options);
if (!options || utils.isEmptyObj(options)) return;
let { hasPhoneNumber, id } = options;
let proData = await this.getProductDetail(id);
if (!proData) {
this.setData({
isLoadding: false,
hasProduct: false
})
return
}
this.setData({
hasPhoneNumber,
productData: proData,
......@@ -100,8 +109,8 @@ Page({
return new Promise((resolve) => {
let _data;
busassistantApi.getDiscoverDetail({id}).then((res) => {
console.log(res);
_data = res.data;
console.log(_data);
resolve(_data);
});
});
......@@ -154,6 +163,13 @@ Page({
wx.$storage.set("scene", options);
const { id } = options;
let proData = await this.getProductDetail(id);
if (!proData) {
this.setData({
isLoadding: false,
hasProduct: false
})
return
}
this.setData({
productData: proData,
});
......
<!--packagesList/pages/productDetail/productDetail.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}">
<view wx:if="{{!isLoadding && hasProduct}}">
<!-- <pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"></pro-detail> -->
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" cardInfo="{{cardInfo}}" proDetail="{{productData}}"></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view>
\ No newline at end of file
</view>
<no-product wx:if="{{!hasProduct}}"></no-product>
\ No newline at end of file
......@@ -13,7 +13,8 @@ Page({
videoData: {},
videoId: '',
isLoadding: true,
showAuth: false
showAuth: false,
hasProduct: true
},
/**
......@@ -23,6 +24,13 @@ Page({
if (!options && options.cardId) return
const { id } = options;
let videoData = await this.getDetailWithLike(id);
if (!videoData) {
this.setData({
isLoadding: false,
hasProduct: false
})
return
}
this.setData({
videoData,
videoId: id,
......@@ -46,6 +54,13 @@ Page({
if (!options || utils.isEmptyObj(options)) return;
let { id } = options;
let videoData = await this.getDetailWithLike(id);
if (!videoData) {
this.setData({
isLoadding: false,
hasProduct: false
})
return
}
this.setData({
videoData,
isLoadding: false,
......
<!--packagesList/pages/videoDetal/videoDetal.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}">
<view wx:if="{{!isLoadding && hasProduct }}">
<gl-video-detail list="{{videoData}}" bind:chooseVideo="chooseVideo"></gl-video-detail>
<phone-number type="{{'video'}}" bindvideodown="downVideo" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
<block wx:if="{{showAuth}}">
<authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
</block>
</view>
\ No newline at end of file
</view>
<no-product wx:if="{{!hasProduct}}"></no-product>
\ No newline at end of file
......@@ -174,9 +174,15 @@ Page({
// 场景跳转
senceClick(e) {
// 如果没有sceneCode,或者没有配置banner跳转 isBannerLink 1-有配置 2-没有配置
if (!e.detail.sceneCode || e.detail.isBannerLink == 2) return
const { hasPhoneNumber } = this.data
const { scenIndex } = e.detail
wx.$router.go('/packagesList/pages/scenarioDetail/scenarioDetail', { hasPhoneNumber, actNum: scenIndex })
// 获取场景
let systemItem = this.data.systemData.find(item => item.sceneCode == e.detail.sceneCode)
let productItem = this.data.productData.find(item => item.sceneCode == e.detail.sceneCode)
const id = systemItem?.productList[0].id || productItem?.productList[0].id
if (!id) return
wx.$router.go('/packagesList/pages/productDetail/productDetail', { hasPhoneNumber, id })
},
// 获取全部活动列表
getActivityRecord() {
......
......@@ -26,7 +26,7 @@
<gl-scenario list="{{productData}}" activityList="{{activityList}}" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" bindleftClick="leftClick" bindcurrentScen="getCurrentScen"></gl-scenario>
</block>
<block wx:if="{{curTabIndex == 1}}">
<gl-subscription list="{{systemData}}" bindmenuClick="sysMenuClick" bannerUrl="{{subscriptionBannerUrl}}" bind:proClick="proClick" data-name="客户数字化" bind:videoClick="videoClick" />
<gl-subscription list="{{systemData}}" bindmenuClick="sysMenuClick" bind:proClick="proClick" data-name="客户数字化" bind:videoClick="videoClick" bindsenceClick="senceClick" />
</block>
<block wx-if="{{curTabIndex == 2}}">
<company-introduce autoplay="{{autoplay}}" />
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!