Commit 13da40db by 匡雅琴

修改组件

1 parent 9dab5509
...@@ -32,7 +32,8 @@ ...@@ -32,7 +32,8 @@
"phone-number": "components/PhoneNumber/PhoneNumber", "phone-number": "components/PhoneNumber/PhoneNumber",
"navigation-bar": "/components/NavigationBar/NavigationBar", "navigation-bar": "/components/NavigationBar/NavigationBar",
"glsx-image": "/components/image/index", "glsx-image": "/components/image/index",
"loadding": "/components/loadding/loadding" "loadding": "/components/loadding/loadding",
"no-product": "/components/NoProduct/index"
}, },
"resolveAlias": { "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 \ 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 \ 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 @@ ...@@ -32,8 +32,8 @@
align-items: center; align-items: center;
} }
.company-logo{ .company-logo{
width: 296rpx; width: 172rpx;
height: 60rpx; height: 48rpx;
} }
.user-company text { .user-company text {
font-size: 18rpx; font-size: 18rpx;
......
...@@ -140,9 +140,10 @@ Component({ ...@@ -140,9 +140,10 @@ Component({
}, },
// 长按图片 // 长按图片
handleLongPress(e) { handleLongPress(e) {
console.log(e);
let {item} = e.currentTarget.dataset
// 如果图片有长按事件 posterEventType: 1-无 2-有 // 如果图片有长按事件 posterEventType: 1-无 2-有
if (item.posterEventType == 1) return if (item.posterEventType == 1) return
let {item} = e.currentTarget.dataset
wx.downloadFile({ wx.downloadFile({
url: item.posterEventUrl, url: item.posterEventUrl,
success: function (res) { success: function (res) {
......
...@@ -10,9 +10,9 @@ ...@@ -10,9 +10,9 @@
"integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ==" "integrity": "sha512-hFJ48SCSvRgcwT/9TcxwNnNnWSpy2BpaBfwQwVdU6uwgFH+2OqGL435VQN7EDpIMH8YjHbiM84hueTyxAzIPqQ=="
}, },
"glsx-applet-component": { "glsx-applet-component": {
"version": "1.1.9", "version": "1.1.10",
"resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.9.tgz", "resolved": "https://registry.npmjs.org/glsx-applet-component/-/glsx-applet-component-1.1.10.tgz",
"integrity": "sha512-8bVPzgXafaAc+kWUjuT0i+kLxCm/2VFxzN4ZqK5ZbRDxdbCKBNAmXjHYcMwN1Eg9Fli4ZqL7mIHsGCbyZU9doQ==" "integrity": "sha512-0jJ1RT28em/lU4sak53LlU8hNgVWpgqDtF+2XxFMxlD8lT8jopA2zrEARJArRvjp0SNyxe58UXAdhJ/a8R/KdA=="
} }
} }
} }
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
"main": "app.js", "main": "app.js",
"dependencies": { "dependencies": {
"@vant/weapp": "^1.10.9", "@vant/weapp": "^1.10.9",
"glsx-applet-component": "^1.1.9" "glsx-applet-component": "^1.1.10"
}, },
"devDependencies": {}, "devDependencies": {},
"scripts": { "scripts": {
......
...@@ -57,6 +57,7 @@ Page({ ...@@ -57,6 +57,7 @@ Page({
trackData.EXPANGOLD, trackData.EXPANGOLD,
], ],
isLoadding: true, isLoadding: true,
hasProduct: true
}, },
// 计算属性 // 计算属性
computed: { computed: {
...@@ -80,9 +81,17 @@ Page({ ...@@ -80,9 +81,17 @@ Page({
//接受跳转的路由参数(小程序页面跳转) //接受跳转的路由参数(小程序页面跳转)
async onRoute(options) { async onRoute(options) {
console.log(options);
if (!options || utils.isEmptyObj(options)) return; if (!options || utils.isEmptyObj(options)) return;
let { hasPhoneNumber, id } = options; let { hasPhoneNumber, id } = options;
let proData = await this.getProductDetail(id); let proData = await this.getProductDetail(id);
if (!proData) {
this.setData({
isLoadding: false,
hasProduct: false
})
return
}
this.setData({ this.setData({
hasPhoneNumber, hasPhoneNumber,
productData: proData, productData: proData,
...@@ -100,8 +109,8 @@ Page({ ...@@ -100,8 +109,8 @@ Page({
return new Promise((resolve) => { return new Promise((resolve) => {
let _data; let _data;
busassistantApi.getDiscoverDetail({id}).then((res) => { busassistantApi.getDiscoverDetail({id}).then((res) => {
console.log(res);
_data = res.data; _data = res.data;
console.log(_data);
resolve(_data); resolve(_data);
}); });
}); });
...@@ -154,6 +163,13 @@ Page({ ...@@ -154,6 +163,13 @@ Page({
wx.$storage.set("scene", options); wx.$storage.set("scene", options);
const { id } = options; const { id } = options;
let proData = await this.getProductDetail(id); let proData = await this.getProductDetail(id);
if (!proData) {
this.setData({
isLoadding: false,
hasProduct: false
})
return
}
this.setData({ this.setData({
productData: proData, productData: proData,
}); });
......
<!--packagesList/pages/productDetail/productDetail.wxml--> <!--packagesList/pages/productDetail/productDetail.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding> <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':''}}" 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-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> <pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view> </view>
<no-product wx:if="{{!hasProduct}}"></no-product>
\ No newline at end of file \ No newline at end of file
...@@ -13,7 +13,8 @@ Page({ ...@@ -13,7 +13,8 @@ Page({
videoData: {}, videoData: {},
videoId: '', videoId: '',
isLoadding: true, isLoadding: true,
showAuth: false showAuth: false,
hasProduct: true
}, },
/** /**
...@@ -23,6 +24,13 @@ Page({ ...@@ -23,6 +24,13 @@ Page({
if (!options && options.cardId) return if (!options && options.cardId) return
const { id } = options; const { id } = options;
let videoData = await this.getDetailWithLike(id); let videoData = await this.getDetailWithLike(id);
if (!videoData) {
this.setData({
isLoadding: false,
hasProduct: false
})
return
}
this.setData({ this.setData({
videoData, videoData,
videoId: id, videoId: id,
...@@ -46,6 +54,13 @@ Page({ ...@@ -46,6 +54,13 @@ Page({
if (!options || utils.isEmptyObj(options)) return; if (!options || utils.isEmptyObj(options)) return;
let { id } = options; let { id } = options;
let videoData = await this.getDetailWithLike(id); let videoData = await this.getDetailWithLike(id);
if (!videoData) {
this.setData({
isLoadding: false,
hasProduct: false
})
return
}
this.setData({ this.setData({
videoData, videoData,
isLoadding: false, isLoadding: false,
......
<!--packagesList/pages/videoDetal/videoDetal.wxml--> <!--packagesList/pages/videoDetal/videoDetal.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding> <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> <gl-video-detail list="{{videoData}}" bind:chooseVideo="chooseVideo"></gl-video-detail>
<phone-number type="{{'video'}}" bindvideodown="downVideo" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number> <phone-number type="{{'video'}}" bindvideodown="downVideo" hasPhoneNumber="{{hasPhoneNumber}}"></phone-number>
<block wx:if="{{showAuth}}"> <block wx:if="{{showAuth}}">
<authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize> <authorize title="下载前需要获取您的‘添加到相册’权限,是否打开授权设置?" scopeType="writePhotosAlbum" buttonType="openSetting" bindfail="authFail" bindsuccess="authSuccess" show="{{showAuth}}"></authorize>
</block> </block>
</view> </view>
<no-product wx:if="{{!hasProduct}}"></no-product>
\ No newline at end of file \ No newline at end of file
...@@ -174,9 +174,15 @@ Page({ ...@@ -174,9 +174,15 @@ Page({
// 场景跳转 // 场景跳转
senceClick(e) { senceClick(e) {
// 如果没有sceneCode,或者没有配置banner跳转 isBannerLink 1-有配置 2-没有配置
if (!e.detail.sceneCode || e.detail.isBannerLink == 2) return
const { hasPhoneNumber } = this.data 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() { getActivityRecord() {
......
...@@ -26,7 +26,7 @@ ...@@ -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> <gl-scenario list="{{productData}}" activityList="{{activityList}}" bindactivityClick="activityClick" bindproClick="proClick" bind:videoClick="videoClick" bindsenceClick="senceClick" bindleftClick="leftClick" bindcurrentScen="getCurrentScen"></gl-scenario>
</block> </block>
<block wx:if="{{curTabIndex == 1}}"> <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>
<block wx-if="{{curTabIndex == 2}}"> <block wx-if="{{curTabIndex == 2}}">
<company-introduce autoplay="{{autoplay}}" /> <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!