Compare commits

...

12 Commits

Author SHA1 Message Date
1154079537
991f55a47d bug修复 2024-05-25 18:07:07 +08:00
1154079537
011fcbc2e4 scrollview定位 2024-05-25 11:20:18 +08:00
1154079537
50409cd8c4 文字修改 2024-05-24 18:04:37 +08:00
1154079537
b0ccfc9f29 抖动bug修改 2024-05-22 17:29:52 +08:00
6478239fc2 删除多余代码 2024-05-22 14:57:08 +08:00
1154079537
df16e85df9 购物车登录 2024-05-22 14:55:39 +08:00
1154079537
50787f1df9 iOS暂存 2024-05-21 17:57:15 +08:00
1154079537
fb98086acd 登录修改 2024-05-21 17:16:07 +08:00
1154079537
728f3c0611 无微信不能登录限制 2024-05-21 16:29:01 +08:00
1154079537
1669b9be74 首页和滚动优化 2024-05-20 17:15:51 +08:00
1154079537
a3c032b3e4 首页滚动修改 订单修改 2024-05-18 19:46:22 +08:00
1154079537
86df2a2950 文字修改 2024-05-18 19:41:57 +08:00
22 changed files with 1982 additions and 1652 deletions

View File

@ -64,27 +64,36 @@
<!-- tab导航 -->
<view class="tabs" v-if="showTab" :style="{top:'calc(98rpx + var(--status-bar-height))'}">
<block v-for="(item,indx) in tabsArr" :key="indx">
<view v-if="indx>0" style="width: 3rpx;height: 36rpx;background-color: #ccc;"></view>
<view :class="{'tabs-item-active':item.val==currTabs}" class="tabs-item" @click="changeTab(item.val)">
<view class="tabs-item-main">{{item.name}}</view>
<view class="tabs-item-sub">{{item.desc}}</view>
</view>
</block>
</view>
<view class='recommendList' :class="indexP?'on':''">
<view class="loadingicon acea-row row-center-wrapper"
<view class="tabs-wrap">
<block v-for="(item,indx) in tabsArr" :key="indx">
<view v-if="indx>0" style="width: 3rpx;height: 36rpx;background-color: #ccc;"></view>
<view :class="{'tabs-item-active':item.val==currTabs}" class="tabs-item"
@click="changeTab(item.val)">
<view class="tabs-item-main">{{item.name}}</view>
<view class="tabs-item-sub">{{item.desc}}</view>
</view>
</block>
</view>
<view class="loadingicon acea-row row-center-wrapper tabs-loading"
:style="{height:((!hostProduct || hostProduct.length == 0 || loading) && isShow)?'80rpx':'0rpx'}"
v-if="!hostProduct || hostProduct.length == 0 || loading">
<text class="loading iconfont icon-jiazai loading-flex"></text>
{{ hotTitle }}
</view>
</view>
<view class='recommendList' :class="indexP?'on':''">
<!-- <view class="loadingicon acea-row row-center-wrapper"
v-if="!hostProduct || hostProduct.length == 0 || loading">
<text class="loading iconfont icon-jiazai loading-flex"></text>
{{ hotTitle }}
</view> -->
<WaterfallsFlow v-if="hostProduct.length>0" :wfList='hostProduct' @itemTap="goDetail" :type="0"
:sale_type="sale_type" />
<view class='pictrue' v-if="!loading && hostProduct.length==0">
<!-- <view class='pictrue' v-if="!loading && hostProduct.length==0">
<image :src="`${domain}/static/images/noCart.png`"></image>
<view>暂无商品看点别的吧</view>
</view>
</view> -->
</view>
</view>
</template>
@ -171,11 +180,22 @@
}],
currTabs: 1,
list: [],
tabsTop: ''
tabsTop: '',
isShow: true
};
},
mounted() {
this.getArticleList();
uni.$on('scroll', res => {
uni.$u.debounce(() => {
if (res && res.scrollTop > this.tabsTop) {
this.isShow = false;
} else {
this.isShow = true;
}
}, 500)
})
},
methods: {
@ -197,18 +217,19 @@
limit: 10
}).then(res => {
this.list = res.data.list;
setTimeout(() => {
this.$util.getDom(this, '.tabs', res => {
console.log(res.top);
// #ifdef APP
this.tabsTop = res.top + 10;
this.tabsTop = res.top;
// #endif
// #ifdef H5
this.tabsTop = res.top;
// #endif
})
}, 300)
}, 1000)
})
},
goDetail(item) {
@ -236,6 +257,11 @@
</script>
<style scoped lang="scss">
.topLoading {
position: sticky;
z-index: 10;
}
.common-hd {
display: flex;
align-items: center;
@ -306,13 +332,19 @@
position: sticky;
top: 0;
z-index: 900;
background: #fff;
padding-bottom: 20rpx;
display: flex;
justify-content: space-between;
align-items: center;
margin: 0 -20rpx 10rpx;
padding-top: 20rpx;
.tabs-wrap {
display: flex;
justify-content: space-between;
align-items: center;
height: 110rpx;
background: #fff;
}
.tabs-loading {
height: 80rpx;
}
.tabs-item {
width: 23%;
@ -350,7 +382,6 @@
.recommend .recommendList {
padding: 0 20rpx;
min-height: 100rpx;
min-height: calc(100vh - 82rpx - var(--status-bar-height));
}

View File

@ -16,8 +16,8 @@ let openPlantGrass = '-openPlantGrass-'
let httpSix, httpApi;
// const env = 'dev'; // 开发
// const env = 'prod'; // 生产
const env = 'prew'; // 预上线
const env = 'prod'; // 生产
// const env = 'prew'; // 预上线
switch (env) {
case 'prod':
@ -77,4 +77,5 @@ module.exports = {
TOKENNAME: 'X-Token',
// 缓存时间 0 永久
EXPIRE: 0,
AUTH_EXPIRE_TIME: 20 * 1000 //秒
};

View File

@ -1,353 +1,353 @@
{
"name": "惠农生活",
"appid": "__UNI__3A527D1",
"description": "",
"versionName": "2.0.53",
"versionCode": 2053,
"transformPx": false,
/* 5+App */
"app-plus": {
"titleNView": true,
"usingComponents": true,
"nvueCompiler": "uni-app",
"nvueStyleCompiler": "uni-app",
"compilerVersion": 3,
"compatible": {
"ignoreVersion": true //trueHBuilderX1.9.0
},
"splashscreen": {
"alwaysShowBeforeRender": false,
"waiting": false,
"autoclose": true,
"delay": 0
},
/* */
"modules": {
"VideoPlayer": {},
"OAuth": {},
"Payment": {},
"Share": {},
"iBeacon": {},
"Maps": {},
"Geolocation": {},
"UniMP": {
"description": "uni小程序"
},
"Push": {},
"Barcode": {},
"Camera": {}
},
"safearea": {
"bottom": {
"offset": "none"
}
},
/* */
"distribute": {
/* android */
"android": {
"permissions": [
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
],
"abiFilters": ["armeabi-v7a", "arm64-v8a", "x86"],
"permissionExternalStorage": {
"request": "none",
"prompt": "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
},
"permissionPhoneState": {
"request": "none" //
},
"minSdkVersion": 23,
"targetSdkVersion": 30
},
/* ios */
"ios": {
"privacyDescription": {
"NSPhotoLibraryUsageDescription": "上传用户头像保存分享海报",
"NSPhotoLibraryAddUsageDescription": "上传用户头像保存分享海报",
"NSCameraUsageDescription": "上传用户头像保存分享海报",
"NSLocationWhenInUseUsageDescription": "根据客户地理位置推荐最近门店",
"NSLocationAlwaysUsageDescription": "根据客户地理位置推荐最近门店"
},
"idfa": false,
"dSYMs": false
},
/* SDK */
"sdkConfigs": {
"maps": {
"amap": {
"appkey_ios": "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android": "0354f5ddc11e2ea76c5aac647f44d945",
"name": "amapIvoVHpJR"
}
},
"payment": {
"weixin": {
"__platform__": ["ios", "android"],
"appid": "wx2e8f79ff281284f5",
"UniversalLinks": "https://shop.lihaink.cn/"
}
},
"share": {
"weixin": {
"appid": "wx2e8f79ff281284f5",
"UniversalLinks": "https://shop.lihaink.cn/"
}
},
"geolocation": {
"amap": {
"name": "amapIvoVHpJR",
"__platform__": ["ios", "android"],
"appkey_ios": "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android": "0354f5ddc11e2ea76c5aac647f44d945"
}
},
"push": {},
"oauth": {
"weixin": {
"appid": "wx2e8f79ff281284f5",
"UniversalLinks": "https://shop.lihaink.cn/"
},
"univerify": {}
},
"ad": {}
},
"icons": {
"android": {
"hdpi": "unpackage/res/icons/72x72.png",
"xhdpi": "unpackage/res/icons/96x96.png",
"xxhdpi": "unpackage/res/icons/144x144.png",
"xxxhdpi": "unpackage/res/icons/192x192.png"
},
"ios": {
"appstore": "unpackage/res/icons/1024x1024.png",
"ipad": {
"app": "unpackage/res/icons/76x76.png",
"app@2x": "unpackage/res/icons/152x152.png",
"notification": "unpackage/res/icons/20x20.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"proapp@2x": "unpackage/res/icons/167x167.png",
"settings": "unpackage/res/icons/29x29.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"spotlight": "unpackage/res/icons/40x40.png",
"spotlight@2x": "unpackage/res/icons/80x80.png"
},
"iphone": {
"app@2x": "unpackage/res/icons/120x120.png",
"app@3x": "unpackage/res/icons/180x180.png",
"notification@2x": "unpackage/res/icons/40x40.png",
"notification@3x": "unpackage/res/icons/60x60.png",
"settings@2x": "unpackage/res/icons/58x58.png",
"settings@3x": "unpackage/res/icons/87x87.png",
"spotlight@2x": "unpackage/res/icons/80x80.png",
"spotlight@3x": "unpackage/res/icons/120x120.png"
}
}
},
"splashscreen": {
"useOriginalMsgbox": true,
"androidStyle": "common"
}
},
"nativePlugins": {
"JG-JCore": {
"JPUSH_APPKEY_IOS": "8a5efd65cda14fafa6e64ad3",
"JPUSH_CHANNEL_IOS": "8a5efd65cda14fafa6e64ad3",
"JPUSH_APPKEY_ANDROID": "b5f679f4357018605ea6fd2e",
"JPUSH_CHANNEL_ANDROID": "",
"__plugin_info__": {
"name": "JG-JCore",
"description": "极光推送JCore插件",
"platforms": "Android,iOS",
"url": "",
"android_package_name": "uni.UNI3A527D1",
"ios_bundle_id": "",
"isCloud": false,
"bought": -1,
"pid": "",
"parameters": {
"JPUSH_APPKEY_IOS": {
"des": "[iOS]极光portal配置应用信息时分配的AppKey",
"key": "JCore:APP_KEY",
"value": "daebe19b547c43128796a078"
},
"JPUSH_CHANNEL_IOS": {
"des": "[iOS]用于统计分发渠道不需要可填默认值developer-default",
"key": "JCore:CHANNEL",
"value": ""
},
"JPUSH_APPKEY_ANDROID": {
"des": "[Android]极光portal配置应用信息时分配的AppKey",
"key": "JPUSH_APPKEY",
"value": ""
},
"JPUSH_CHANNEL_ANDROID": {
"des": "[Android]用于统计分发渠道不需要可填默认值developer-default",
"key": "JPUSH_CHANNEL",
"value": ""
}
}
}
},
"JG-JPush": {
"JPUSH_ISPRODUCTION_IOS": "true",
"JPUSH_ADVERTISINGID_IOS": "",
"JPUSH_DEFAULTINITJPUSH_IOS": "true",
"JPUSH_OPPO_APPKEY": "",
"JPUSH_OPPO_APPID": "",
"JPUSH_OPPO_APPSECRET": "",
"JPUSH_VIVO_APPKEY": "",
"JPUSH_VIVO_APPID": "",
"JPUSH_MEIZU_APPKEY": "",
"JPUSH_MEIZU_APPID": "",
"JPUSH_XIAOMI_APPKEY": "",
"JPUSH_XIAOMI_APPID": "",
"__plugin_info__": {
"name": "JG-JPush",
"description": "极光推送Hbuilder插件",
"platforms": "Android,iOS",
"url": "",
"android_package_name": "uni.UNI3A527D1",
"ios_bundle_id": "",
"isCloud": false,
"bought": -1,
"pid": "",
"parameters": {
"JPUSH_ISPRODUCTION_IOS": {
"des": "[iOS]是否是生产环境是填true不是填false或者不填",
"key": "JPush:ISPRODUCTION",
"value": ""
},
"JPUSH_ADVERTISINGID_IOS": {
"des": "[iOS]广告标识符IDFA如果不需要使用IDFA可不填",
"key": "JPush:ADVERTISINGID",
"value": ""
},
"JPUSH_DEFAULTINITJPUSH_IOS": {
"des": "[iOS]是否默认初始化是填true不是填false或者不填",
"key": "JPush:DEFAULTINITJPUSH",
"value": ""
},
"JPUSH_OPPO_APPKEY": {
"des": "厂商OPPO-appkey,示例OP-12345678",
"key": "OPPO_APPKEY",
"value": ""
},
"JPUSH_OPPO_APPID": {
"des": "厂商OPPO-appId,示例OP-12345678",
"key": "OPPO_APPID",
"value": ""
},
"JPUSH_OPPO_APPSECRET": {
"des": "厂商OPPO-appSecret,示例OP-12345678",
"key": "OPPO_APPSECRET",
"value": ""
},
"JPUSH_VIVO_APPKEY": {
"des": "厂商VIVO-appkey,示例12345678",
"key": "com.vivo.push.api_key",
"value": ""
},
"JPUSH_VIVO_APPID": {
"des": "厂商VIVO-appId,示例12345678",
"key": "com.vivo.push.app_id",
"value": ""
},
"JPUSH_MEIZU_APPKEY": {
"des": "厂商MEIZU-appKey,示例MZ-12345678",
"key": "MEIZU_APPKEY",
"value": ""
},
"JPUSH_MEIZU_APPID": {
"des": "厂商MEIZU-appId,示例MZ-12345678",
"key": "MEIZU_APPID",
"value": ""
},
"JPUSH_XIAOMI_APPKEY": {
"des": "厂商XIAOMI-appKey,示例MI-12345678",
"key": "XIAOMI_APPKEY",
"value": ""
},
"JPUSH_XIAOMI_APPID": {
"des": "厂商XIAOMI-appId,示例MI-12345678",
"key": "XIAOMI_APPID",
"value": ""
}
}
}
}
}
},
/* */
"quickapp": {},
/* */
"mp-weixin": {
"appid": "wx5fb1cc8edb3f8baa",
"setting": {
"urlCheck": false,
"minified": true,
"postcss": true,
"es6": true
},
"permission": {
"scope.userLocation": {
"desc": "获取您的位置"
}
},
"requiredPrivateInfos": ["getLocation", "chooseAddress"],
"usingComponents": true,
"__usePrivacyCheck__": true
},
"mp-alipay": {
"usingComponents": true
},
"mp-baidu": {
"usingComponents": true
},
"mp-toutiao": {
"usingComponents": true
},
"h5": {
"devServer": {
"https": false
},
"router": {
"mode": "history",
"base": ""
},
"domain": "",
"sdkConfigs": {
"maps": {
"qqmap": {
"key": "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7"
}
}
},
"title": "加载中...",
"template": "template.h5.html",
"optimization": {
"treeShaking": {
"enable": true
}
}
}
"name" : "惠农生活",
"appid" : "__UNI__3A527D1",
"description" : "",
"versionName" : "2.0.26",
"versionCode" : 2026,
"transformPx" : false,
/* 5+App */
"app-plus" : {
"titleNView" : true,
"usingComponents" : true,
"nvueCompiler" : "uni-app",
"nvueStyleCompiler" : "uni-app",
"compilerVersion" : 3,
"compatible" : {
"ignoreVersion" : true //trueHBuilderX1.9.0
},
"splashscreen" : {
"alwaysShowBeforeRender" : false,
"waiting" : false,
"autoclose" : true,
"delay" : 0
},
/* */
"modules" : {
"VideoPlayer" : {},
"OAuth" : {},
"Payment" : {},
"Share" : {},
"iBeacon" : {},
"Maps" : {},
"Geolocation" : {},
"UniMP" : {
"description" : "uni小程序"
},
"Push" : {},
"Barcode" : {},
"Camera" : {}
},
"safearea" : {
"bottom" : {
"offset" : "none"
}
},
/* */
"distribute" : {
/* android */
"android" : {
"permissions" : [
"<uses-permission android:name=\"android.permission.ACCESS_COARSE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_FINE_LOCATION\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_LOCATION_EXTRA_COMMANDS\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.ACCESS_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.BATTERY_STATS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH\"/>",
"<uses-permission android:name=\"android.permission.CALL_PHONE\"/>",
"<uses-permission android:name=\"android.permission.CAMERA\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_CONFIGURATION\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_NETWORK_STATE\"/>",
"<uses-permission android:name=\"android.permission.CHANGE_WIFI_STATE\"/>",
"<uses-permission android:name=\"android.permission.MODIFY_AUDIO_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.MOUNT_UNMOUNT_FILESYSTEMS\"/>",
"<uses-permission android:name=\"android.permission.READ_LOGS\"/>",
"<uses-permission android:name=\"android.permission.READ_PHONE_STATE\"/>",
"<uses-permission android:name=\"android.permission.VIBRATE\"/>",
"<uses-permission android:name=\"android.permission.WAKE_LOCK\"/>",
"<uses-permission android:name=\"android.permission.WRITE_SETTINGS\"/>",
"<uses-permission android:name=\"android.permission.BLUETOOTH_ADMIN\"/>"
],
"abiFilters" : [ "armeabi-v7a", "arm64-v8a", "x86" ],
"permissionExternalStorage" : {
"request" : "none",
"prompt" : "应用保存运行状态等信息,需要获取读写手机存储(系统提示为访问设备上的照片、媒体内容和文件)权限,请允许。"
},
"permissionPhoneState" : {
"request" : "none" //
},
"minSdkVersion" : 23,
"targetSdkVersion" : 30
},
/* ios */
"ios" : {
"privacyDescription" : {
"NSPhotoLibraryUsageDescription" : "上传用户头像保存分享海报",
"NSPhotoLibraryAddUsageDescription" : "上传用户头像保存分享海报",
"NSCameraUsageDescription" : "上传用户头像保存分享海报",
"NSLocationWhenInUseUsageDescription" : "根据客户地理位置推荐最近门店",
"NSLocationAlwaysUsageDescription" : "根据客户地理位置推荐最近门店"
},
"idfa" : false,
"dSYMs" : false
},
/* SDK */
"sdkConfigs" : {
"maps" : {
"amap" : {
"appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945",
"name" : "amapIvoVHpJR"
}
},
"payment" : {
"weixin" : {
"__platform__" : [ "ios", "android" ],
"appid" : "wx2e8f79ff281284f5",
"UniversalLinks" : "https://shop.lihaink.cn/"
}
},
"share" : {
"weixin" : {
"appid" : "wx2e8f79ff281284f5",
"UniversalLinks" : "https://shop.lihaink.cn/"
}
},
"geolocation" : {
"amap" : {
"name" : "amapIvoVHpJR",
"__platform__" : [ "ios", "android" ],
"appkey_ios" : "0a3202688624938fd5d2f37b52c30d5d",
"appkey_android" : "0354f5ddc11e2ea76c5aac647f44d945"
}
},
"push" : {},
"oauth" : {
"weixin" : {
"appid" : "wx2e8f79ff281284f5",
"UniversalLinks" : "https://shop.lihaink.cn/"
},
"univerify" : {}
},
"ad" : {}
},
"icons" : {
"android" : {
"hdpi" : "unpackage/res/icons/72x72.png",
"xhdpi" : "unpackage/res/icons/96x96.png",
"xxhdpi" : "unpackage/res/icons/144x144.png",
"xxxhdpi" : "unpackage/res/icons/192x192.png"
},
"ios" : {
"appstore" : "unpackage/res/icons/1024x1024.png",
"ipad" : {
"app" : "unpackage/res/icons/76x76.png",
"app@2x" : "unpackage/res/icons/152x152.png",
"notification" : "unpackage/res/icons/20x20.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"proapp@2x" : "unpackage/res/icons/167x167.png",
"settings" : "unpackage/res/icons/29x29.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"spotlight" : "unpackage/res/icons/40x40.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png"
},
"iphone" : {
"app@2x" : "unpackage/res/icons/120x120.png",
"app@3x" : "unpackage/res/icons/180x180.png",
"notification@2x" : "unpackage/res/icons/40x40.png",
"notification@3x" : "unpackage/res/icons/60x60.png",
"settings@2x" : "unpackage/res/icons/58x58.png",
"settings@3x" : "unpackage/res/icons/87x87.png",
"spotlight@2x" : "unpackage/res/icons/80x80.png",
"spotlight@3x" : "unpackage/res/icons/120x120.png"
}
}
},
"splashscreen" : {
"useOriginalMsgbox" : true,
"androidStyle" : "common"
}
},
"nativePlugins" : {
"JG-JCore" : {
"JPUSH_APPKEY_IOS" : "8a5efd65cda14fafa6e64ad3",
"JPUSH_CHANNEL_IOS" : "8a5efd65cda14fafa6e64ad3",
"JPUSH_APPKEY_ANDROID" : "b5f679f4357018605ea6fd2e",
"JPUSH_CHANNEL_ANDROID" : "",
"__plugin_info__" : {
"name" : "JG-JCore",
"description" : "极光推送JCore插件",
"platforms" : "Android,iOS",
"url" : "",
"android_package_name" : "uni.UNI3A527D1",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {
"JPUSH_APPKEY_IOS" : {
"des" : "[iOS]极光portal配置应用信息时分配的AppKey",
"key" : "JCore:APP_KEY",
"value" : "daebe19b547c43128796a078"
},
"JPUSH_CHANNEL_IOS" : {
"des" : "[iOS]用于统计分发渠道不需要可填默认值developer-default",
"key" : "JCore:CHANNEL",
"value" : ""
},
"JPUSH_APPKEY_ANDROID" : {
"des" : "[Android]极光portal配置应用信息时分配的AppKey",
"key" : "JPUSH_APPKEY",
"value" : ""
},
"JPUSH_CHANNEL_ANDROID" : {
"des" : "[Android]用于统计分发渠道不需要可填默认值developer-default",
"key" : "JPUSH_CHANNEL",
"value" : ""
}
}
}
},
"JG-JPush" : {
"JPUSH_ISPRODUCTION_IOS" : "true",
"JPUSH_ADVERTISINGID_IOS" : "",
"JPUSH_DEFAULTINITJPUSH_IOS" : "true",
"JPUSH_OPPO_APPKEY" : "",
"JPUSH_OPPO_APPID" : "",
"JPUSH_OPPO_APPSECRET" : "",
"JPUSH_VIVO_APPKEY" : "",
"JPUSH_VIVO_APPID" : "",
"JPUSH_MEIZU_APPKEY" : "",
"JPUSH_MEIZU_APPID" : "",
"JPUSH_XIAOMI_APPKEY" : "",
"JPUSH_XIAOMI_APPID" : "",
"__plugin_info__" : {
"name" : "JG-JPush",
"description" : "极光推送Hbuilder插件",
"platforms" : "Android,iOS",
"url" : "",
"android_package_name" : "uni.UNI3A527D1",
"ios_bundle_id" : "",
"isCloud" : false,
"bought" : -1,
"pid" : "",
"parameters" : {
"JPUSH_ISPRODUCTION_IOS" : {
"des" : "[iOS]是否是生产环境是填true不是填false或者不填",
"key" : "JPush:ISPRODUCTION",
"value" : ""
},
"JPUSH_ADVERTISINGID_IOS" : {
"des" : "[iOS]广告标识符IDFA如果不需要使用IDFA可不填",
"key" : "JPush:ADVERTISINGID",
"value" : ""
},
"JPUSH_DEFAULTINITJPUSH_IOS" : {
"des" : "[iOS]是否默认初始化是填true不是填false或者不填",
"key" : "JPush:DEFAULTINITJPUSH",
"value" : ""
},
"JPUSH_OPPO_APPKEY" : {
"des" : "厂商OPPO-appkey,示例OP-12345678",
"key" : "OPPO_APPKEY",
"value" : ""
},
"JPUSH_OPPO_APPID" : {
"des" : "厂商OPPO-appId,示例OP-12345678",
"key" : "OPPO_APPID",
"value" : ""
},
"JPUSH_OPPO_APPSECRET" : {
"des" : "厂商OPPO-appSecret,示例OP-12345678",
"key" : "OPPO_APPSECRET",
"value" : ""
},
"JPUSH_VIVO_APPKEY" : {
"des" : "厂商VIVO-appkey,示例12345678",
"key" : "com.vivo.push.api_key",
"value" : ""
},
"JPUSH_VIVO_APPID" : {
"des" : "厂商VIVO-appId,示例12345678",
"key" : "com.vivo.push.app_id",
"value" : ""
},
"JPUSH_MEIZU_APPKEY" : {
"des" : "厂商MEIZU-appKey,示例MZ-12345678",
"key" : "MEIZU_APPKEY",
"value" : ""
},
"JPUSH_MEIZU_APPID" : {
"des" : "厂商MEIZU-appId,示例MZ-12345678",
"key" : "MEIZU_APPID",
"value" : ""
},
"JPUSH_XIAOMI_APPKEY" : {
"des" : "厂商XIAOMI-appKey,示例MI-12345678",
"key" : "XIAOMI_APPKEY",
"value" : ""
},
"JPUSH_XIAOMI_APPID" : {
"des" : "厂商XIAOMI-appId,示例MI-12345678",
"key" : "XIAOMI_APPID",
"value" : ""
}
}
}
}
}
},
/* */
"quickapp" : {},
/* */
"mp-weixin" : {
"appid" : "wx5fb1cc8edb3f8baa",
"setting" : {
"urlCheck" : false,
"minified" : true,
"postcss" : true,
"es6" : true
},
"permission" : {
"scope.userLocation" : {
"desc" : "获取您的位置"
}
},
"requiredPrivateInfos" : [ "getLocation", "chooseAddress" ],
"usingComponents" : true,
"__usePrivacyCheck__" : true
},
"mp-alipay" : {
"usingComponents" : true
},
"mp-baidu" : {
"usingComponents" : true
},
"mp-toutiao" : {
"usingComponents" : true
},
"h5" : {
"devServer" : {
"https" : false
},
"router" : {
"mode" : "history",
"base" : ""
},
"domain" : "",
"sdkConfigs" : {
"maps" : {
"qqmap" : {
"key" : "SMJBZ-WCHK4-ZPZUA-DSIXI-XDDVQ-XWFX7"
}
}
},
"title" : "加载中...",
"template" : "template.h5.html",
"optimization" : {
"treeShaking" : {
"enable" : true
}
}
}
}

View File

@ -51,7 +51,7 @@
}, {
"path": "pages/whole_sale/index",
"style": {
"enablePullDownRefresh": false,
"enablePullDownRefresh": true,
"navigationBarTitleText": "批发",
"navigationStyle": "custom"
}
@ -388,14 +388,14 @@
"style": {
"navigationBarTitleText": "里海云仓",
"navigationStyle": "custom",
"enablePullDownRefresh": false
"enablePullDownRefresh": true
}
},
{
"path": "market/market",
"style": {
"navigationBarTitleText": "供销云市场",
"enablePullDownRefresh": false,
"enablePullDownRefresh": true,
"navigationStyle": "custom"
}
},
@ -403,7 +403,7 @@
"path": "specialty/specialty",
"style": {
"navigationBarTitleText": "名优特产",
"enablePullDownRefresh": false,
"enablePullDownRefresh": true,
"navigationStyle": "custom"
}
}

View File

@ -113,7 +113,7 @@
</div>
<div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic">
{{ item.product.price }}
{{ saleType == 1? item.product.price :item.product.wholesale_price}}
</div>
<div class="broadcast_details_tit_no line1">
{{item.product.store_name}}
@ -271,7 +271,7 @@
</div>
<div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic">
{{ item.product.price }}
{{ saleType == 1? item.product.price :item.product.wholesale_price}}
</div>
<div class="broadcast_details_tit_no line1">
{{item.product.store_name}}
@ -459,7 +459,7 @@
</div>
<div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic">
{{ item.product.price }}
{{ saleType == 1? item.product.price :item.product.wholesale_price}}
</div>
<div class="broadcast_details_tit_no line1">
{{item.product.store_name}}
@ -612,7 +612,7 @@
</div>
<div class="broadcast_details_picBox_no noPad">
<div class="broadcast_details_pic">
{{ item.product.price }}
{{ saleType == 1? item.product.price :item.product.wholesale_price}}
</div>
<div class="broadcast_details_tit_no line1">
{{item.product.store_name}}
@ -718,7 +718,7 @@
<div class="broadcast_details_tit">{{productInfo.store_name}}</div>
<div class="acea-row row-between product_price">
<div class="broadcast_details_pic p-color">
{{ productInfo.price}}
{{ saleType == 1 ? productInfo.price :productInfo.wholesale_price}}
</div>
<div class="broadcast_details_btn product_btn" @click="sendProduct">发送商品</div>
</div>
@ -957,7 +957,8 @@
httpUrl: '',
press: false,
index: 0,
j: 0
j: 0,
saleType: ''
};
},
watch: {
@ -983,8 +984,9 @@
this.combinationId = parseInt(option.combinationId) || 0;
this.orderId = option.order_id || ""
this.mer_id = option.mer_id || 0
this.refund_order_id = option.refund_order_id || 0
this.userId = option.userId || 0
this.refund_order_id = option.refund_order_id || 0;
this.userId = option.userId || 0;
this.saleType = option.sale_type || '';
uni.getSystemInfo({
success: function(res) {
self.windowH = res.windowHeight
@ -1006,6 +1008,10 @@
});
});
// #endif
var isWholeSale = this.$store.state.app.userInfo?.mer_info?.wholesale
console.log(isWholeSale);
},
onReady() {
this.httpUrl = `${HTTP_REQUEST_URL}/static/look.png`;
@ -1452,7 +1458,8 @@
sendProduct() {
consultApi({
user_id: this.toUid,
product_id: this.productId
product_id: this.productId,
sale_type: this.saleType
})
if (this.presellId || this.combinationId) {
if (this.presellId) {

View File

@ -1,3 +1,292 @@
<template>
<view class="wholeSale" @touchstart="onTouchStart" @touchmove="onTouchMove">
<!-- 顶部 -->
<view class="wholeSale-header">
<!-- 适配不同机 -->
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;">
<view style="display: flex;font-weight: bold;font-size: 32rpx;"><u-icon style="margin-right: 20rpx;"
name="arrow-left" size="20" color="#fff" @click="navBack"></u-icon>里海云仓</view>
</view>
</view>
<view :style="{height:'calc(' +wrapHeight+ 'rpx + 92rpx + var(--status-bar-height))'}"></view>
<!-- 分类区域 -->
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-nav">
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)"
hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索商品名称" :value="where.keyword"
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
</view>
</view>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true" :scroll-into-view="scrollIndex">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :id="'scroll' + index"
:class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
<view class="category-all" v-if="store_category.length > 0" @click="onAllCategory">
<view style="margin-bottom: 10rpx;">全部</view>
<u-icon name="list"></u-icon>
</view>
</view>
<!-- 商品小分类 -->
<view class="cate" v-if="store_category_children.length>1">
<scroll-view scroll-x="true">
<view class="cate-wrap">
<block v-for="(item,index) in store_category_children" :key="index">
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
@click="changeChildrenCate(index)">
<text>{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
</view>
<!-- 内容 -->
<view class="wholeSale-con">
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
</view>
<!-- 弹框大分类 -->
<uni-popup ref="popup" type="top" border-radius="10px 10px 0 0" z-index="1000">
<view class="popup-wrap">
<view style="height: var(--status-bar-height);"></view>
<view class="popup-wrap-title">分类</view>
<view class="popup-wrap-category">
<view class="popup-wrap-category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="popup-wrap-category-item"
:class="{'popup-wrap-category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="popup-wrap-category-item-img" width="108rpx" :src="item.pic"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="popup-wrap-category-item-text">{{item.cate_name}}</text>
</view>
</block>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {
goShopDetail
} from '@/libs/order.js'
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
import {
getStoreCategory,
getProductslist
} from "@/api/store.js"
export default {
components: {
WaterfallsFlow
},
data() {
return {
hostProduct: [],
store_category: [], //
store_category_children: [], //
cate_change: 0,
cate_change_children: 0,
isLoading: 0,
isScroll: false,
where: {
page: 1,
limit: 20,
mer_type: 1, //1-, 2-, 3-
cate_pid: '',
keyword: '',
deduction_rate: '', //
rand: 1
},
wrapHeight: 300,
touchstarty: 0,
scrollIndex: ''
}
},
onLoad(option) {
this.getStoreCategory();
this.getProductslist(true);
},
onPageScroll() {
uni.$emit('scroll');
},
onPullDownRefresh() {
this.getProductslist(true);
},
onReachBottom() {
this.getProductslist();
},
methods: {
//
onTouchStart(e) {
this.touchstarty = e.touches[0].clientY;
},
//
onTouchMove(e) {
this.$nextTick(() => {
let deltaY = e.changedTouches[0].clientY - this.touchstarty;
if (deltaY <= 0) {
console.log("上滑")
this.wrapHeight = 0;
} else {
console.log('下滑');
if (this.where.cate_pid) this.wrapHeight = 360;
else this.wrapHeight = 300;
}
this.$forceUpdate();
})
},
onAllCategory() {
this.$refs.popup.open();
},
navTo(url) {
uni.navigateTo({
url: url,
success: () => {
uni.$once('searchValue', (e) => {
this.$nextTick(() => {
this.where.keyword = e;
this.getProductslist(true);
})
})
}
})
},
changeCate(e) {
this.cate_change = e;
this.store_category_children = [];
if (this.store_category[e].children) this.store_category_children = [...this.store_category[e].children];
this.store_category_children.unshift({
cate_name: '全部',
store_category_id: ''
})
this.cate_change_children = 0;
this.where.cate_pid = this.store_category[e].store_category_id;
this.getProductslist(true);
if (this.where.cate_pid) this.wrapHeight = 360;
else this.wrapHeight = 300;
// scrollView
this.scrollIndex = 'scroll' + e;
this.$refs.popup && this.$refs.popup.close();
},
changeChildrenCate(e) {
this.cate_change_children = e;
this.where.cate_pid = this.store_category_children[e].store_category_id;
if (e == 0) this.where.cate_pid = this.store_category[this.cate_change]
.store_category_id; // , id
this.getProductslist(true);
},
getStoreCategory() {
getStoreCategory(259).then(res => {
this.store_category = [{
cate_name: '全部',
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0bc7a202404021652194310.png',
store_category_id: ''
}, ...res.data];
this.store_category_children = this.store_category[0].children || [];
this.store_category_children.unshift({
cate_name: '全部',
store_category_id: ''
})
})
},
getProductslist(reLoad = false) {
if (reLoad) {
this.where.page = 1;
this.hostProduct = [];
this.isLoading = 0;
}
if (this.isLoading == -1) return;
this.isLoading = 1;
getProductslist(this.where).then(res => {
uni.stopPullDownRefresh();
this.where.limit = res.data.limit
this.where.page = res.data.page
this.hostProduct = [...this.hostProduct, ...res.data.list];
this.isLoading = 0;
if (res.data.list.length < this.where.limit) {
this.isLoading = -1;
}
this.where.page++;
}).catch(err => {
uni.stopPullDownRefresh();
})
},
goDetail(item) {
goShopDetail(item, this.uid).then(res => {
if (this.isLogin) {
initiateAssistApi(item.activity_id).then(res => {
let id = res.data.product_assist_set_id;
uni.hideLoading();
uni.navigateTo({
url: '/pages/activity/assist_detail/index?id=' + id
});
}).catch((err) => {
uni.showToast({
title: err,
icon: 'none'
})
});
} else {
toLogin();
}
})
},
navBack() {
uni.navigateBack();
}
}
}
</script>
<style lang="scss" scoped>
page {
background-color: #f8fafb !important;
@ -7,26 +296,28 @@
background-color: #f8fafb !important;
.wholeSale-header {
position: sticky;
position: fixed;
top: 0;
z-index: 9;
z-index: 98;
width: 100%;
margin-bottom: 20rpx;
background-color: #40AE36;
}
.wholeSale-section {
position: sticky;
top: calc(82rpx + var(--status-bar-height));
position: fixed;
z-index: 97;
width: 100%;
top: calc(80rpx + var(--status-bar-height));
padding: 0rpx 20rpx;
background-color: #fff;
transition: height .5s;
overflow: hidden;
margin-bottom: 20rpx;
.wholeSale-nav {
display: flex;
align-items: center;
padding-bottom: 20rpx;
padding: 20rpx 0;
.icon {
margin-right: 20rpx;
@ -124,17 +415,16 @@
right: 0;
top: 50%;
transform: translateY(-50%);
height: 100%;
background-color: #f3f3f3;
height: 101%;
z-index: 10;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-size: 24rpx;
border-radius: 4rpx;
width: 70rpx;
color: #919191;
box-shadow: 0px 0px 60rpx #c5c5c5;
}
}
@ -237,294 +527,4 @@
padding-bottom: 30rpx;
}
}
</style>
<template>
<view class="wholeSale">
<!-- 顶部 -->
<view class="wholeSale-header">
<!-- 适配不同机 -->
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
<view style="display: flex;padding: 20rpx 28rpx;background-color: #40af37;color: #fff;">
<view style="display: flex;font-weight: bold;font-size: 32rpx;"><u-icon style="margin-right: 20rpx;"
name="arrow-left" size="20" color="#fff" @click="navBack"></u-icon>里海云仓</view>
</view>
</view>
<!-- 分类区域 -->
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-nav">
<view @click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}`)"
hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text" placeholder="搜索商品名称" :value="where.keyword"
placeholder-style="font-size: 30rpx;color:#999;" disabled style="pointer-events: none;">
</view>
</view>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
<view class="category-all" v-if="store_category.length > 0" @click="onAllCategory">
<view style="margin-bottom: 20rpx;">全部</view>
<u-icon name="list"></u-icon>
</view>
</view>
<!-- 商品小分类 -->
<view class="cate" v-if="store_category_children.length>1">
<scroll-view scroll-x="true">
<view class="cate-wrap">
<block v-for="(item,index) in store_category_children" :key="index">
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
@click="changeChildrenCate(index)">
<text>{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
</view>
<!-- 内容 -->
<view class="wholeSale-con"
:style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx '+(isShowSmall?' - 48rpx':'')+')'}">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
<view>
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
</view>
</scroll-view>
</view>
<!-- 弹框大分类 -->
<uni-popup ref="popup" type="top" border-radius="10px 10px 0 0" z-index="1000">
<view class="popup-wrap">
<view style="height: var(--status-bar-height);"></view>
<view class="popup-wrap-title">分类</view>
<view class="popup-wrap-category">
<view class="popup-wrap-category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="popup-wrap-category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<u--image class="popup-wrap-category-item-img" width="108rpx" :src="item.pic"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="popup-wrap-category-item-text">{{item.cate_name}}</text>
</view>
</block>
</view>
</view>
</view>
</uni-popup>
</view>
</template>
<script>
import {
goShopDetail
} from '@/libs/order.js'
import WaterfallsFlow from '@/components/WaterfallsFlow/WaterfallsFlow.vue'
import {
getStoreCategory,
getProductslist
} from "@/api/store.js"
export default {
components: {
WaterfallsFlow
},
data() {
return {
hostProduct: [],
store_category: [], //
store_category_children: [], //
cate_change: 0,
cate_change_children: 0,
isLoading: 0,
where: {
page: 1,
limit: 20,
mer_type: 1, //1-, 2-, 3-
cate_pid: '',
keyword: '',
deduction_rate: '', //
rand: 1
},
wrapHeight: 300,
isShowSmall: false,
scrollTop: 0,
isTriggered: true
}
},
onLoad(option) {
this.getStoreCategory();
this.getProductslist(true);
},
onPageScroll(e) {
uni.$emit('scroll');
},
watch: {
'where.cate_pid'(newVal, oldVal) {
if (newVal && !oldVal) {
this.wrapHeight = 300 + 48;
this.isShowSmall = true;
}
if (!newVal && oldVal) {
this.wrapHeight = 300;
this.isShowSmall = false;
}
}
},
methods: {
//
onPulling() {
if (!this.isTriggered) {
this.isTriggered = true;
this.getProductslist(true);
}
},
onRefresh(e) {
this.isTriggered = true;
},
onScrollBottom(e) {
this.getProductslist();
},
onAllCategory() {
this.$refs.popup.open();
},
onScroll(e) {
if (this.scrollTop > e.target.scrollTop) { //
this.wrapHeight = 300;
if (this.where.cate_pid) this.wrapHeight = this.wrapHeight + 48;
} else {
this.wrapHeight = 0;
}
this.scrollTop = e.target.scrollTop;
},
navTo(url) {
uni.navigateTo({
url: url,
success: () => {
uni.$once('searchValue', (e) => {
this.$nextTick(() => {
this.where.keyword = e;
this.getProductslist(true);
})
})
}
})
},
navBack() {
uni.navigateBack();
},
changeCate(e) {
this.cate_change = e;
this.store_category_children = [];
if (this.store_category[e].children) this.store_category_children = [...this.store_category[e].children];
this.store_category_children.unshift({
cate_name: '全部',
store_category_id: ''
})
this.cate_change_children = 0;
this.where.cate_pid = this.store_category[e].store_category_id;
this.getProductslist(true);
this.$refs.popup && this.$refs.popup.close();
},
changeChildrenCate(e) {
this.cate_change_children = e;
this.where.cate_pid = this.store_category_children[e].store_category_id;
if (e == 0) this.where.cate_pid = this.store_category[this.cate_change]
.store_category_id; // , id
this.getProductslist(true);
},
getStoreCategory() {
getStoreCategory(259).then(res => {
this.store_category = [{
cate_name: '全部',
pic: 'https://lihai001.oss-cn-chengdu.aliyuncs.com/def/0bc7a202404021652194310.png',
store_category_id: ''
}, ...res.data];
this.store_category_children = this.store_category[0].children || [];
this.store_category_children.unshift({
cate_name: '全部',
store_category_id: ''
})
})
},
getProductslist(reLoad = false) {
if (reLoad) {
this.where.page = 1;
this.hostProduct = [];
this.isLoading = 0;
}
if (this.isLoading == -1) return;
this.isLoading = 1;
getProductslist(this.where).then(res => {
this.where.limit = res.data.limit
this.where.page = res.data.page
this.isTriggered = false;
this.hostProduct = [...this.hostProduct, ...res.data.list];
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
this.where.page++;
}).catch(err => {
this.isTriggered = false;
})
},
goDetail(item) {
goShopDetail(item, this.uid).then(res => {
if (this.isLogin) {
initiateAssistApi(item.activity_id).then(res => {
let id = res.data.product_assist_set_id;
uni.hideLoading();
uni.navigateTo({
url: '/pages/activity/assist_detail/index?id=' + id
});
}).catch((err) => {
uni.showToast({
title: err,
icon: 'none'
})
});
} else {
toLogin();
}
})
}
}
}
</script>
</style>

View File

@ -1,5 +1,5 @@
<template>
<view class="wholeSale">
<view class="wholeSale" @touchstart="onTouchStart" @touchmove="onTouchMove">
<!-- 适配不同机 -->
<view class="wholeSale-header">
@ -26,6 +26,8 @@
</view>
</view>
<view :style="{height:'calc(' + wrapHeight + 'rpx + 92rpx + var(--status-bar-height))'}"></view>
<!-- 分类区域 -->
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-nav">
@ -42,11 +44,11 @@
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<scroll-view scroll-x="true" :scroll-into-view="scrollIndex">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<view class="category-item" :id="'scroll' + index"
:class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.background"
height="108rpx" shape="circle">
<template v-slot:loading>
@ -67,55 +69,50 @@
</view>
<!-- 列表 -->
<view class="goods_list" :style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx)'}">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
<view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar">
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<view class="goods_list">
<view class="goods" v-for="(item, index) in goodsList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar">
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
</view>
<view class="content">
<view class="content-head">
<view class="title">{{item.mer_name}}</view>
<text style="font-size: 21.03rpx;color: #aaa;" v-if="item.sales>=100">月销{{item.sales}}</text>
</view>
<view class="content">
<view class="content-head">
<view class="title">{{item.mer_name}}</view>
<text style="font-size: 21.03rpx;color: #aaa;"
v-if="item.sales>=100">月销{{item.sales}}</text>
</view>
<view class="content-two">
<view class="score">
<view class="star">
<view
:style="{width: `${(item.service_score / 5 * 100).toFixed(0)}%`, backgroundImage: `url(${domain}/static/diy/score1${keyColor}.png)`}">
</view>
<view class="content-two">
<view class="score">
<view class="star">
<view
:style="{width: `${(item.service_score / 5 * 100).toFixed(0)}%`, backgroundImage: `url(${domain}/static/diy/score1${keyColor}.png)`}">
</view>
</view>
<text
style="margin-left: 20rpx;color: #FF6D20;font-size: 22.78rpx; ">{{item.service_score}}</text>
<text v-if="item.distance"
style="margin-left: 20rpx;font-size: 21.03rpx;color: #aaa;">{{item.distance}}</text>
<text style="margin-left:20rpx;" class="line1">{{item.category_name}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text> {{item.service_phone}}</text>
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true"
src="/static/images/GXSC/SJ.png" width="33.85rpx" height="33.85rpx"></u--image>
<text v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text class="address">{{item.mer_address}}</text>
</view>
<text
style="margin-left: 20rpx;color: #FF6D20;font-size: 22.78rpx; ">{{item.service_score}}</text>
<text v-if="item.distance"
style="margin-left: 20rpx;font-size: 21.03rpx;color: #aaa;">{{item.distance}}</text>
<text style="margin-left:20rpx;" class="line1">{{item.category_name}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text> {{item.service_phone}}</text>
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true"
src="/static/images/GXSC/SJ.png" width="33.85rpx" height="33.85rpx"></u--image>
<text v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text class="address">{{item.mer_address}}</text>
</view>
</view>
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
</scroll-view>
</view>
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
</view>
<!-- 弹框大分类 -->
@ -181,6 +178,7 @@
cate_change: 0,
goodsList: [],
isLoading: 0,
isScroll: false,
isShowAddress: false,
street: '定位中',
where: {
@ -193,8 +191,8 @@
location: ''
},
wrapHeight: 300,
scrollTop: 0,
isTriggered: false
touchstarty: 0,
scrollIndex: ''
}
},
computed: {
@ -206,6 +204,19 @@
hide_mer_status: '',
}, mapGetters(['viewColor', 'keyColor'])),
},
onPageScroll() {
uni.$emit('scroll');
},
onPullDownRefresh() {
this.storeMerchantList(true);
},
onReachBottom() {
this.storeMerchantList();
},
onLoad(option) {
let getAddress = uni.getStorageSync('getAddress');
let closeShow = uni.getStorageSync('closeShow');
@ -221,39 +232,33 @@
this.merClassifly();
this.storeMerchantList();
},
onPageScroll() {
uni.$emit('scroll');
},
methods: {
//
onPulling() {
if (!this.isTriggered) {
this.isTriggered = true;
this.storeMerchantList(true);
}
//
onTouchStart(e) {
this.touchstarty = e.touches[0].clientY;
},
onRefresh(e) {
this.isTriggered = true;
},
onScrollBottom(e) {
this.storeMerchantList();
//
onTouchMove(e) {
this.$nextTick(() => {
let deltaY = e.changedTouches[0].clientY - this.touchstarty;
if (deltaY <= 0) {
console.log("上滑")
this.wrapHeight = 0;
} else {
console.log('下滑');
this.wrapHeight = 300;
}
this.$forceUpdate();
})
},
onAllCategory() {
this.$refs.popup.open();
},
onScroll(e) {
if (this.scrollTop > e.target.scrollTop) { //
this.wrapHeight = 300;
} else {
this.wrapHeight = 0;
}
this.scrollTop = e.target.scrollTop;
},
navTo(url) {
uni.navigateTo({
url: url,
@ -276,15 +281,20 @@
this.where.merchant_category_id = this.store_category[e].merchant_category_id;
this.storeMerchantList(true);
// scrollView
this.scrollIndex = 'scroll' + e;
this.$refs.popup && this.$refs.popup.close();
this.$forceUpdate();
},
//
goStore(id) {
uni.navigateTo({
url: `/pages/store/home/index?id=${id}`
})
},
merClassifly() {
merClassifly().then(res => {
this.store_category = [{
@ -294,6 +304,7 @@
}, ...res.data];
})
},
storeMerchantList(reLoad = false) {
if (reLoad) {
this.where.page = 1;
@ -303,19 +314,21 @@
if (this.isLoading == -1) return;
this.isLoading = 1;
storeMerchantList(this.where).then(res => {
this.isTriggered = false;
uni.stopPullDownRefresh();
this.goodsList = [...this.goodsList, ...res.data.list];
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
this.where.page++;
}).catch(() => {
this.isTriggered = false;
uni.stopPullDownRefresh();
})
},
closeShowAddress() {
this.isShowAddress = false;
uni.setStorageSync('closeShow', true);
},
//
changeMap() {
uni.navigateTo({
@ -347,6 +360,7 @@
}
})
},
getLocation() {
uni.getLocation({
type: 'gcj02',
@ -403,7 +417,7 @@
})
}
})
},
}
}
}
</script>
@ -421,33 +435,33 @@
}
.wholeSale-header {
position: sticky;
position: fixed;
top: 0;
z-index: 90;
margin-bottom: 20rpx;
width: 100%;
background-color: #40AE36;
}
.wholeSale-section {
position: sticky;
top: calc(82rpx + var(--status-bar-height));
position: fixed;
z-index: 10;
top: calc(80rpx + var(--status-bar-height));
width: 100%;
padding: 0rpx 20rpx;
background-color: #fff;
transition: height .5s;
overflow: hidden;
margin-bottom: 20rpx;
.wholeSale-nav {
display: flex;
align-items: center;
margin-bottom: 40rpx;
padding: 20rpx 0;
.icon {
margin-right: 20rpx;
}
.search_content {
// margin-bottom: 40rpx;
flex: 1;
height: 70rpx;
padding: 2px 2px 2px 21.05rpx;
@ -540,16 +554,15 @@
top: 50%;
transform: translateY(-50%);
height: 100%;
background-color: #f3f3f3;
z-index: 10;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-size: 24rpx;
border-radius: 4rpx;
width: 70rpx;
color: #919191;
box-shadow: 0px 0px 60rpx #c5c5c5;
}
}
}

View File

@ -1,5 +1,5 @@
<template>
<view class="wholeSale">
<view class="wholeSale" @touchstart="onTouchStart" @touchmove="onTouchMove">
<!-- 适配不同机 -->
<view class="wholeSale-header">
<view style="height: var(--status-bar-height);background-color: #40af37;"></view>
@ -9,6 +9,8 @@
</view>
</view>
<view :style="{height:'calc(' + wrapHeight + 'rpx + 92rpx + var(--status-bar-height))'}"></view>
<view class="wholeSale-section" :style="{height:wrapHeight + 'rpx'}">
<view class="wholeSale-nav">
<!-- 搜索 -->
@ -24,11 +26,11 @@
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<scroll-view scroll-x="true" :scroll-into-view="scrollIndex">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<view class="category-item" :id="'scroll' + index"
:class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
shape="circle">
<template v-slot:loading>
@ -63,16 +65,10 @@
</view>
<!-- 内容 -->
<view class="wholeSale-con" :style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx )'}">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
<view>
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
</view>
</scroll-view>
<view class="wholeSale-con">
<!-- 流水瀑布 -->
<WaterfallsFlow :wfList='hostProduct' @itemTap="goDetail" :type="0" />
<loadmore :type="isLoading" style="padding: 12rpx 0;"></loadmore>
</view>
<!-- 弹框大分类 -->
@ -123,6 +119,7 @@
cate_change: 0,
cate_change_children: 0,
isLoading: 0,
isScroll: false,
where: {
page: 1,
limit: 20,
@ -132,46 +129,53 @@
sale_type: 1, //1-, 2-
},
wrapHeight: 300,
scrollTop: 0,
isTriggered: true
touchstarty: 0,
scrollIndex: ''
}
},
onPageScroll() {
uni.$emit('scroll');
},
onPullDownRefresh() {
this.getProductslist(true);
},
onReachBottom() {
this.getProductslist();
},
onLoad(option) {
this.getCategoryIndexList();
this.getProductslist(true);
},
onPageScroll() {
uni.$emit('scroll');
},
methods: {
//
onPulling() {
if (!this.isTriggered) {
this.isTriggered = true;
this.getProductslist(true);
}
},
onRefresh(e) {
this.isTriggered = true;
//
onTouchStart(e) {
this.touchstarty = e.touches[0].clientY;
},
onScrollBottom(e) {
this.getProductslist();
//
onTouchMove(e) {
this.$nextTick(() => {
let deltaY = e.changedTouches[0].clientY - this.touchstarty;
if (deltaY <= 0) {
console.log("上滑")
this.wrapHeight = 0;
} else {
console.log('下滑');
this.wrapHeight = 300;
}
this.$forceUpdate();
})
},
onAllCategory() {
this.$refs.popup.open();
},
onScroll(e) {
if (this.scrollTop > e.target.scrollTop) { //
this.wrapHeight = 300;
} else {
this.wrapHeight = 0;
}
this.scrollTop = e.target.scrollTop;
},
navTo(url) {
uni.navigateTo({
url: url,
@ -203,6 +207,9 @@
this.where.cate_pid = this.store_category[e].store_category_id;
this.getProductslist(true);
// scrollView
this.scrollIndex = 'scroll' + e;
this.$refs.popup && this.$refs.popup.close();
this.$forceUpdate();
},
@ -241,13 +248,13 @@
if (this.isLoading == -1) return;
this.isLoading = 1;
getProductslist(this.where).then(res => {
this.isTriggered = false;
uni.stopPullDownRefresh();
this.hostProduct = [...this.hostProduct, ...res.data.list];
this.where.page++;
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
}).catch(() => {
this.isTriggered = false;
uni.stopPullDownRefresh();
})
},
goDetail(item) {
@ -282,27 +289,27 @@
.wholeSale {
.wholeSale-header {
position: sticky;
position: fixed;
top: 0;
z-index: 90;
width: 100%;
background-color: #40AE36;
}
.wholeSale-section {
position: sticky;
top: calc(82rpx + var(--status-bar-height));
position: fixed;
top: calc(80rpx + var(--status-bar-height));
width: 100%;
padding: 0rpx 20rpx;
background-color: #fff;
transition: height .5s;
overflow: hidden;
margin-bottom: 20rpx;
padding-top: 20rpx;
z-index: 20;
z-index: 89;
.wholeSale-nav {
display: flex;
align-items: center;
margin-bottom: 40rpx;
padding: 20rpx 0;
.icon {
margin-right: 20rpx;
@ -401,16 +408,15 @@
top: 50%;
transform: translateY(-50%);
height: 100%;
background-color: #f3f3f3;
z-index: 10;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-size: 24rpx;
border-radius: 4rpx;
width: 70rpx;
color: #919191;
box-shadow: 0px 0px 60rpx #c5c5c5;
}
}
}

View File

@ -893,9 +893,7 @@
getConfig() {
let self = this
//
getconfig().then(res => {
}).catch(err => {})
getconfig().then(res => {}).catch(err => {})
},
/**到货通知*/
arrivalNotice() {
@ -1504,7 +1502,7 @@
toLogin()
} else {
uni.navigateTo({
url: `/pages/chat/customer_list/chat?mer_id=${that.storeInfo.mer_id}&uid=${that.uid}&productId=${that.id}`
url: `/pages/chat/customer_list/chat?mer_id=${that.storeInfo.mer_id}&uid=${that.uid}&productId=${that.id}&sale_type=${that.sale_type}`
});
}
},

View File

@ -69,7 +69,11 @@
} from '@/utils';
import {
getGeocoder
} from "@/api/store.js"
} from "@/api/store.js";
import {
AUTH_EXPIRE_TIME
} from "@/config/app.js";
import permission from '@/utils/permission';
export default {
name: 'homeComb',
props: {
@ -135,7 +139,7 @@
isCategory: false,
swiperTop: 0,
isFixed: true,
street: ''
street: '',
};
},
watch: {
@ -230,9 +234,43 @@
methods: {
async scanQRcode() {
// #ifdef APP-PLUS
let result = await this.$store.dispatch("permission/requestPermissions",
'CAMERA')
let result = await this.$store.dispatch("permission/requestPermissions", 'CAMERA');
console.log('权限状态:' + result);
if (result != -1) {
console.log('允许设置...');
uni.removeStorageSync('expireTimeCamera');
} else {
const expireTime = uni.getStorageSync('expireTimeCamera');
console.log('过期时间:' + expireTime);
if (expireTime) {
if ((expireTime + AUTH_EXPIRE_TIME) < +new Date()) {
console.log('时间过期了....')
uni.removeStorageSync('expireTimeCamera');
uni.showModal({
title: '提示',
content: '操作权限已被拒绝,请手动前往设置',
confirmText: "立即设置",
success: (res) => {
if (res.confirm) {
permission.gotoAppSetting();
} else {
//
console.log('重置过期时间');
uni.setStorageSync('expireTimeCamera', +new Date());
}
}
})
} else {
console.log('时间还没过期....');
}
} else {
//
uni.setStorageSync('expireTimeCamera', +new Date());
}
}
if (result !== 1) return;
//
uni.removeStorageSync('expireTimeCamera');
// #endif
uni.scanCode({
success: (res) => {

View File

@ -4,6 +4,7 @@
id="home">
<skeleton :show="showSkeleton" :isNodes="isNodes" ref="skeleton" loading="chiaroscuro" selector="skeleton"
bgcolor="transparent"></skeleton>
<view v-if="!errorNetwork"
:style="{visibility: showSkeleton ? 'hidden' : 'visible', pointerEvents: preview ? 'none' : 'auto'}">
<view class="page-index skeleton" :class="{ bgf: navIndex > 0 }">
@ -399,6 +400,7 @@
import {
showTab
} from "@/utils/showTab.js";
import permission from '../../utils/permission';
export default {
computed: configMap({
hide_mer_status: 0,
@ -576,7 +578,7 @@
this.isScrolled = false
}
// scrollTopeasy-loadimage
uni.$emit('scroll');
uni.$emit('scroll', e);
if (e.scrollTop >= 100) {
uni.setTabBarItem({
@ -625,7 +627,7 @@
let curRoute = routes[routes.length - 1].route //
this.activeRouter = '/' + curRoute
},
onLoad(options) {
async onLoad(options) {
let that = this
this._options = options;
this.diyId = options.diyId || 0;
@ -642,6 +644,16 @@
})
that.pageLoad(options);
this.$store.dispatch('INIT_CONFIG');
// let result = await this.$store.dispatch("permission/requestPermissions",
// 'ACCESS_FINE_LOCATION')
// console.log(result)
// permission.gotoAppSetting();
},
onShow() {
@ -662,6 +674,7 @@
that.isScrolled = res[0].top <= -60
})
})
this.isIndexClick = false;
if (this.isLogin) {

View File

@ -2,8 +2,8 @@
<view>
<view class='newsList'>
<view class='swiper' v-if="imgUrls.length > 0" style="background-color: #fff;">
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval" :duration="duration"
indicator-color="rgba(102,102,102,0.3)" indicator-active-color="#666">
<swiper indicator-dots="true" :autoplay="autoplay" :circular="circular" :interval="interval"
:duration="duration" indicator-color="rgba(102,102,102,0.3)" indicator-active-color="#666">
<block v-for="(item,index) in imgUrls" :key="index">
<swiper-item>
<navigator :url="'/pages/news_details/index?id='+item.id">
@ -13,10 +13,13 @@
</block>
</swiper>
</view>
<view class='nav' v-if="navList.length > 0" style="background-color: #fff;margin-top: 0;padding-top: 30rpx;">
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft" style="width:auto;overflow:hidden;">
<view class='nav' v-if="navList.length > 0"
style="background-color: #fff;margin-top: 0;padding-top: 30rpx;">
<scroll-view class="scroll-view_x" scroll-x scroll-with-animation :scroll-left="scrollLeft"
style="width:auto;overflow:hidden;">
<block v-for="(item,index) in navList" :key="index">
<view class='item' :class='active==item.article_category_id?"on":""' @click='tabSelect(item.article_category_id)'>
<view class='item' :class='active==item.article_category_id?"on":""'
@click='tabSelect(item.article_category_id)'>
<view>{{item.title}}</view>
<view class='line bg-color' v-if="active==item.article_category_id"></view>
</view>
@ -25,24 +28,29 @@
</view>
<view class='list'>
<block v-for="(item,index) in articleList" :key="index">
<navigator :url='"/pages/news_details/index?id="+item.article_id' hover-class='none' class='item acea-row row-between-wrapper my-card'
:class="{'my-card0': index==0}">
<block v-if="index==0">
<image lazy-load style="width: 100%;height: 100%;" :src='item.image_input' mode="aspectFill"></image>
<view class="bottom-text">
<view class='name line2'>{{item.title}}</view>
<view style="color: #C4C4C4;font-size: 24rpx;padding-top: 10rpx;">{{URLdate(item.create_time)}}</view>
</view>
</block>
<navigator :url='"/pages/news_details/index?id="+item.article_id' hover-class='none'
class='item acea-row row-between-wrapper my-card' :class="{'my-card0': index==0}">
<block v-if="index==0">
<image lazy-load style="width: 100%;height: 100%;" :src='item.image_input'
mode="aspectFill"></image>
<view class="bottom-text">
<view class='name line2'>{{item.title}}</view>
<view style="color: #C4C4C4;font-size: 24rpx;padding-top: 10rpx;">
{{URLdate(item.create_time)}}
</view>
</view>
</block>
<block v-else>
<view class='text acea-row row-column-between' style="height: 100%;width: 550rpx;">
<view class='name line2'>{{item.title}}</view>
<view>{{URLdate(item.create_time)}}</view>
</view>
<view class='pictrue'>
<image lazy-load style="width: 100%;height: 100%;" :src='item.image_input' mode="aspectFill"></image>
</view>
</block>
<view class='text'
style="height: 100%;width: 550rpx;display: flex;flex-direction: column;justify-content: space-between;">
<view class='name line2'>{{item.title}}</view>
<view>{{URLdate(item.create_time)}}</view>
</view>
<view class='pictrue'>
<image lazy-load style="width: 100%;height: 100%;" :src='item.image_input'
mode="aspectFill"></image>
</view>
</block>
</navigator>
</block>
</view>
@ -53,7 +61,6 @@
<view class="txt">暂无新闻信息~</view>
</view>
</view>
<!-- <home></home> -->
</view>
</template>
@ -103,14 +110,13 @@
* 生命周期函数--监听页面显示
*/
onLoad: function(options) {
this.status = false;
this.page = 1;
this.articleList = [];
if(options.type) {
this.active=options.type;
this.getCidArticle();
}
else this.getArticleCate();
this.status = false;
this.page = 1;
this.articleList = [];
if (options.type) {
this.active = options.type;
this.getCidArticle();
} else this.getArticleCate();
},
/**
* 页面上拉触底事件的处理函数
@ -169,19 +175,19 @@
this.getCidArticle();
}
},
URLdate(date){
// Date
const currentDate = new Date(date);
//
const year = currentDate.getFullYear();
const month = String(currentDate.getMonth() + 1).padStart(2, '0'); // 01
const day = String(currentDate.getDate()).padStart(2, '0');
// xxxxxxxx
const formattedDate = `${year}${month}${day}`;
return formattedDate;
}
URLdate(date) {
// Date
const currentDate = new Date(date);
//
const year = currentDate.getFullYear();
const month = String(currentDate.getMonth() + 1).padStart(2, '0'); // 01
const day = String(currentDate.getDate()).padStart(2, '0');
// xxxxxxxx
const formattedDate = `${year}${month}${day}`;
return formattedDate;
}
}
}
</script>
@ -190,22 +196,26 @@
page {
background-color: #f8f9fa !important;
}
.newsList .swiper {
width: 100%;
position: relative;
box-sizing: border-box;
padding: 0 30rpx;
}
.newsList .swiper swiper {
width: 100%;
height: 365rpx;
position: relative;
}
.newsList .swiper .slide-image {
width: 100%;
height: 335rpx;
border-radius: 6rpx;
}
// #ifdef MP-WEIXIN
.newsList .swiper .wx-swiper-dot {
width: 12rpx !important;
@ -214,9 +224,11 @@
transform: rotate(-45deg);
transform-origin: 0 100%;
}
.newsList .swiper .wx-swiper-dot~.wx-swiper-dot {
margin-left: 5rpx;
}
.newsList .swiper .wx-swiper-dots.wx-swiper-dots-horizontal {
margin-bottom: -15rpx;
}
@ -230,12 +242,15 @@
transform: rotate(-45deg);
transform-origin: 0 100%;
}
.newsList .swiper .uni-swiper-dot~.uni-swiper-dot {
margin-left: 5rpx;
}
.newsList .swiper .uni-swiper-dots.uni-swiper-dots-horizontal {
margin-bottom: -15rpx;
}
// #endif
.newsList .nav {
padding: 0 30rpx;
@ -244,6 +259,7 @@
box-sizing: border-box;
margin-top: 43rpx;
}
.newsList .nav .item {
display: inline-block;
font-size: 32rpx;
@ -256,12 +272,15 @@
padding-bottom: 20rpx;
text-align: center;
}
.newsList .nav .item.on {
color: #282828;
}
.newsList .nav .item~.item {
margin-left: 46rpx;
}
.newsList .nav .item .line {
width: 24rpx;
height: 4rpx;
@ -272,93 +291,110 @@
left: 50%;
margin-left: -12rpx;
}
.newsList .list .item {
margin: 0 30rpx;
border-bottom: 1px solid #f0f0f0;
padding: 35rpx 0;
}
.newsList .list .item .pictrue {
width: 250rpx;
height: 156rpx;
}
.newsList .list .item .pictrue image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
.newsList .list .item .text {
width: 420rpx;
height: 160rpx;
font-size: 24rpx;
color: #999;
}
.newsList .list .item .text .name {
font-size: 30rpx;
color: #282828;
}
.newsList .list .item .picList .pictrue {
width: 335rpx;
height: 210rpx;
margin-top: 30rpx;
}
.newsList .list .item .picList.on .pictrue {
width: 217rpx;
height: 136rpx;
}
.newsList .list .item .picList .pictrue image {
width: 100%;
height: 100%;
border-radius: 6rpx;
}
.newsList .list .item .time {
text-align: right;
font-size: 24rpx;
color: #999;
margin-top: 22rpx;
}
.noCommodity{
.noCommodity {
border: none;
}
.empty-box{
.empty-box {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 200rpx;
image{
image {
width: 414rpx;
height: 240rpx;
}
.txt{
.txt {
font-size: 26rpx;
color: #999;
text-align: center;
}
}
.my-card{
background-color: #fff !important;
margin: 20rpx !important;
padding: 20rpx !important;
border-radius: 20rpx !important;
overflow: hidden;
height: 160rpx !important;
.pictrue{
height: 116rpx !important;
width: 116rpx !important;
}
}
.my-card0{
padding: 0 !important;
height: 478rpx !important;
position: relative;
.bottom-text{
position: absolute;
bottom: 0;
left: 0;
width: 100%;
color: #fff;
background-color: rgba(0, 0, 0, 0.3);
padding: 20rpx;
}
}
</style>
.my-card {
background-color: #fff !important;
margin: 20rpx !important;
padding: 20rpx !important;
border-radius: 20rpx !important;
overflow: hidden;
height: 160rpx !important;
.pictrue {
height: 116rpx !important;
width: 116rpx !important;
}
}
.my-card0 {
padding: 0 !important;
height: 478rpx !important;
position: relative;
.bottom-text {
position: absolute;
bottom: 0;
left: 0;
width: 100%;
color: #fff;
background-color: rgba(0, 0, 0, 0.3);
padding: 20rpx;
}
}
</style>

View File

@ -91,7 +91,7 @@
<view class="line1" style="max-width: 260rpx;">
<text class="money-price">{{goods.productAttr.price}}</text>
<text
class="money-unit">/{{goods.productAttr.sku || goods.product.unit_name}}</text>
class="money-unit">/{{goods.product.unit_name || goods.product.unit_name}}</text>
</view>
</view>
</view>

View File

@ -516,6 +516,8 @@
},
watch: {
tabActive: function(value, old) {
if (!value || !old) return;
switch (value) {
case 1:
if (this.goods.length == 0 && this.isCoupon == 0) {
@ -605,7 +607,8 @@
this.getMerClassifly();
//
this.getCart();
if (this.isLogin)
this.getCart();
},
/**

View File

@ -197,18 +197,21 @@
电话认证
</view>
<view class="card-cont">
<view class="card-cont-li">
联系电话 {{formData.phone}}
<view class="card-cont-li" style="justify-content: flex-start;">
<text style="margin-right: 30rpx;width:120rpx;">联系电话</text>
<text>{{formData.phone}}</text>
</view>
<u-line style="margin: 28rpx 0;"></u-line>
<view class="card-cont-li">
<view class="" style="flex: 4;display: flex;align-items: center;">
验证码 <u--input style="margin-left: 40rpx;" border="none" v-model="formData.code">
<text
style="text-align-last: justify;width:108rpx;margin-right:40rpx;">验证码</text>
<u--input border="none" v-model="formData.code" placeholder="请输入验证码">
</u--input>
</view>
<view class="" style="flex: 1;">
<u-button @click="handleVerify" type="success" shape="circle" :plain="true"
:text="text"></u-button>
:text="text" style="height: 60rpx;"></u-button>
</view>
</view>
</view>
@ -258,7 +261,7 @@
<text style="color: #35BD3E;" @click="getConfig">入驻协议</text>
</view>
<view class="submit-btn" v-if='step!=3'>
<u-button text="添加店铺" @click="submit" shape='circle'
<u-button :text="step==1?'添加店铺':'资质认证'" @click="submit" shape='circle'
color=" linear-gradient( 132deg, #38BE41 0%, #20B128 100%)"></u-button>
</view>

View File

@ -8,6 +8,7 @@
<image src="@/static/images/logo1.png" />
</view>
</view>
<view class="" style="margin-top: 10rpx;" v-if='formItem==2'>
<view style="text-align: center;font-size: 36rpx;color: #20B128;font-weight: 700;">
重置密码
@ -16,6 +17,7 @@
请输入手机号码和验证码找回密码重置
</view>
</view>
<view class="whiteBg" v-if="formItem == 0">
<view class="logon" style="display: flex;align-items: center;justify-content: center;"
@click="wxLogin">
@ -31,6 +33,7 @@
</checkbox-group>
</view>
</view>
<view class="whiteBg" v-else-if="formItem === 1">
<view class="title acea-row row-center-wrapper">
<view class="item" :class="current === index ? 'on' : ''" v-for="(item, index) in navList"
@ -165,7 +168,7 @@
</checkbox-group>
</view>
</view>
<view class="footer-btn" v-if="formItem==2">
<view class="footer-btn" v-if="formItem==2 && isInstallWx">
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;">
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text>
<text v-else @click="appOneClcik">本机一键登录</text>
@ -176,6 +179,7 @@
</view>
</view>
</view>
<view class="bottom"></view>
<view class="settlementAgreement" v-if="showAgreement">
<view class="setAgCount">
@ -188,7 +192,7 @@
</view>
<!-- #ifdef APP-PLUS -->
<view class="footer-btns" v-if="formItem !=2">
<view class="footer-btns" v-if="formItem !=2 && isInstallWx">
<view class="login-type-btn" :class="{actLoginType:formItem==0}" style="margin-right: 70rpx;">
<text v-if='formItem == 1||formItem==2' @click="formItem = 0">微信快捷登录</text>
<text v-else @click="appOneClcik">本机一键登录</text>
@ -198,6 +202,12 @@
<text v-else @click="appOneClcik">本机一键登录</text>
</view>
</view>
<view class="footer-btns" v-if="!isInstallWx">
<view class="login-type-btn actLoginType" style="margin: 0 auto;">
<text @click="appOneClcik">{{formItem == 2?'更多登录方式':'本机一键登录'}}</text>
</view>
</view>
<!-- #endif -->
</view>
<form report-submit='true' v-if="auth_token">
@ -240,6 +250,7 @@
</form>
<Verify @success="success" :captchaType="'blockPuzzle'" :imgSize="{ width: '330px', height: '155px' }"
ref="verify"></Verify>
<!-- tips弹窗 -->
<u-overlay :show="showTips">
<view class="tips">
@ -286,8 +297,6 @@
</view>
</u-overlay>
<!-- tips结束 -->
</view>
</template>
<script>
@ -405,7 +414,8 @@
keyLock: true,
auth_token: '',
codeVal: '',
copyright: {}
copyright: {},
isInstallWx: true
};
},
computed: configMap(['login_logo'], mapGetters(['viewColor'])),
@ -431,9 +441,25 @@
});
this.getVersion();
},
mounted: function() {
onShow() {
// #ifdef APP
//
if (plus.runtime.isApplicationExist({
pname: 'com.tencent.mm',
action: 'weixin://'
})) {
//
this.isInstallWx = true;
this.formItem = 0;
} else {
//
this.isInstallWx = false;
this.formItem = 1;
}
// #endif
},
onReady() {
let that = this
// #ifdef MP
@ -1358,6 +1384,9 @@
},
// app
appOneClcik() {
if (this.formItem == 2) return this.formItem = 1;
let that = this
uni.preLogin({
provider: 'univerify',
@ -1382,22 +1411,9 @@
title: '登录失败,请稍后再试'
});
})
// uniCloud.callFunction({
// name: 'oneClickLoginFn',
// data: {
// 'access_token': res.authResult
// .access_token,
// 'openid': res.authResult.openid
// }
// }).then(res => {
// console.log(res, 'res')
// }).catch(err => {
// console.log(err, 'ererre')
// })
},
fail(res) { //
console.log(res.errCode)
console.log(res.errMsg)
uni.closeAuthView()
}
})
},

View File

@ -346,7 +346,7 @@
</image>
</view>
<view class='text acea-row row-between'>
<view class='name '>
<view class='name'>
<view class='name line2' style="margin-bottom:12rpx;">
<text v-if="goods.product_type != 0 && goods.product_type != 10"
:class="'font_bg-red type'+goods.product_type">{{goods.product_type == 1 ? "秒杀" : goods.product_type == 2 ? "预售" : goods.product_type == 3 ? "助力" : goods.product_type == 4 ? "拼团" : ""}}</text>
@ -355,10 +355,15 @@
<text
style="font-size: 22rpx;background-color: #ecfaed;color: #40ae36;border-radius: 40rpx;padding: 5rpx 10rpx;">
{{(item.merchant && item.merchant.cloud_warehouse) || ''}}</text>
<view style="margin-top: 10rpx;" class="t-color">
{{goods.is_refund==1?'退款中':goods.is_refund==2?'部分退款':goods.is_refund==3?'全部退款':''}}
</view>
<view>
{{goods.cart_info.productAttr.sku}}
</view>
</view>
<view class='money' v-if="item.activity_type == 3">
<view v-if="goods.cart_info.productAssistAttr">
{{goods.cart_info.productAssistAttr.assist_price}}</view>

View File

@ -66,12 +66,11 @@
}
</style>
<template>
<view :style="viewColor">
<view :style="viewColor" style="position: relative;z-index: 1000000;background-color: #fff;">
<form @submit="formSubmit" report-submit='true'>
<view class='addAddress'>
<view class='list'>
<view v-if="userAddress.detail != ''" class="sel_addr_update-wrap">
<view v-if="userAddress && userAddress.detail != ''" class="sel_addr_update-wrap">
<view class="sel_addr_update">
<view class="sel_addr_wrap-l">
<view class="sel_addr_wrap-l-addr line1">{{userAddress.detail}}</view>
@ -170,6 +169,10 @@
getGeocoder
} from '@/api/store.js';
import authorize from '@/components/Authorize';
import permission from '@/utils/permission';
import {
AUTH_EXPIRE_TIME
} from "@/config/app.js"
export default {
components: {
areaWindow,
@ -205,7 +208,7 @@
longitude: '',
detail: '', //15
location: '', //
timer: null
};
},
computed: {
@ -233,11 +236,18 @@
this.isShowAuth = true
}
},
onShow() {
// if (this.timer) clearInterval(this.timer);
// this.timer = setInterval(() => {
// console.log(new Date().getSeconds())
// }, 1000)
},
methods: {
//
handleToChoose() {
async handleToChoose() {
let that = this;
// #ifdef H5
uni.navigateTo({
url: "/pages/select_address_n/select_address_n",
@ -251,15 +261,78 @@
}
})
// #endif
// #ifndef H5
let result = await that.$store.dispatch("permission/requestPermissions", 'ACCESS_FINE_LOCATION');
console.log('权限状态:' + result);
if (result != -1) {
console.log('允许设置...');
uni.removeStorageSync('expireTime');
const isOpen = permission.isOpenGps();
if (isOpen) {
that.getLocation();
} else {
uni.showModal({
title: '提示',
content: '您未开启GPS定位可能导致不能获取准确定位是否继续',
confirmText: "继续",
success: (res) => {
if (res.confirm) {
that.getLocation();
}
}
})
}
} else {
const expireTime = uni.getStorageSync('expireTime');
console.log('过期时间:' + expireTime);
if (expireTime) {
if ((expireTime + AUTH_EXPIRE_TIME) < +new Date()) {
console.log('时间过期了....')
uni.removeStorageSync('expireTime');
uni.showModal({
title: '提示',
content: '操作权限已被拒绝,请手动前往设置',
confirmText: "立即设置",
success: (res) => {
if (res.confirm) {
permission.gotoAppSetting();
} else {
//
console.log('重置过期时间');
uni.setStorageSync('expireTime', +new Date());
}
}
})
} else {
console.log('时间还没过期....');
}
} else {
//
uni.setStorageSync('expireTime', +new Date());
}
}
// #endif
},
//
getLocation() {
let that = this;
uni.chooseLocation({
success: function(res) {
that.userAddress.detail = res.name
that.userAddress.address_detail = res.address;
that.location = `${res.latitude},${res.longitude}`;;
that.userAddress.detail =
res.name
that.userAddress
.address_detail = res
.address;
that.location =
`${res.latitude},${res.longitude}`;;
},
fail(err) {
console.log(err);
}
});
// #endif
},
OnChangeAddress(address) {

View File

@ -1,207 +1,202 @@
<template>
<view class="wholeSale">
<view class="wholeSale" @touchstart="onTouchStart" @touchmove="onTouchMove">
<!-- 顶部 -->
<view class="wholeSale-header">
<view class="wholeSale-header-wrap">
<!-- 适配不同机 -->
<view style="height: var(--status-bar-height);"></view>
<!-- 适配不同机 -->
<view style="height: var(--status-bar-height);"></view>
<!-- 滚动tab -->
<scroll-view scroll-x="true" :scroll-top="100" :show-scrollbar="false" scroll-into-view="a1">
<view class="scrollview">
<block v-for="(item,indx) in tabsArr" :key="indx">
<view class="scrollview-item" :id="'a' + indx"
:class="{'scrollview-active':tabsCurr == item.val}" @click="tabsChange(item.val)">
{{item.name}}
<!-- 滚动tab -->
<scroll-view scroll-x="true" :scroll-top="100" :show-scrollbar="false" scroll-into-view="a1">
<view class="scrollview">
<block v-for="(item,indx) in tabsArr" :key="indx">
<view class="scrollview-item" :id="'a' + indx"
:class="{'scrollview-active':tabsCurr == item.val}" @click="tabsChange(item.val)">
{{item.name}}
</view>
</block>
</view>
</scroll-view>
</view>
<!-- 占位 -->
<view :style="{height:'calc(' + wrapHeight + 'rpx + 108rpx + var(--status-bar-height))'}"></view>
<view class="wholeSale-header-search-wrap" :style="{height:wrapHeight + 'rpx'}">
<u-subsection v-if="tabsCurr==2" :list="subList" @change="changeSub" :current="subCurr" mode="subsection"
activeColor="#40ae36" fontSize="14" style="margin-top: 20rpx;"></u-subsection>
<view class="wholeSale-nav">
<view
@click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}&shop=${subCurr!=1 || (subCurr==1 && tabsCurr!=2) ? false : true}`)"
hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text"
:placeholder="subCurr!=1 || (subCurr==1 && tabsCurr!=2) ? '搜索您需要批发进货的产品名称': '搜索店铺名称'"
:value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;" disabled
style="pointer-events: none;">
</view>
</view>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true" :scroll-into-view="scrollIndex">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :id="'scroll' + index"
:class="{'category-item-active': index==cate_change}" @click="changeCate(index)">
<block v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
<u--image class="category-item-img" width="108rpx" :src="item.pic" height="108rpx"
shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.cate_name}}</text>
</block>
<block v-else>
<u--image class="category-item-img" width="108rpx" :src="item.background"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.category_name}}</text>
</block>
</view>
</block>
</view>
</scroll-view>
<view class="category-all" v-if="store_category.length > 0" @click="onAllCategory">
<view style="margin-bottom: 20rpx;">全部</view>
<u-icon name="list"></u-icon>
</view>
</view>
<!-- 商品小分类 -->
<view class="cate" v-if="store_category_children.length>1">
<scroll-view scroll-x="true">
<view class="cate-wrap">
<block v-for="(item,index) in store_category_children" :key="index">
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
@click="changeChildrenCate(index)">
<text>{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
</view>
<view class="wholeSale-header-search-wrap" :style="{height:wrapHeight + 'rpx'}">
<u-subsection v-if="tabsCurr==2" :list="subList" @change="changeSub" :current="subCurr"
mode="subsection" activeColor="#40ae36" fontSize="14" style="margin-bottom: 24rpx;"></u-subsection>
<view class="wholeSale-nav">
<view
@click="navTo(`/pages/columnGoods/goods_search/index?back=true&searchVal=${where.keyword}&shop=${subCurr!=1 || (subCurr==1 && tabsCurr!=2) ? false : true}`)"
hover-class="none" class="search_content flex_a_c_j_sb">
<view class="flex_a_c search_content_wrap">
<view class="iconfont icon-sousuo" style="font-size: 39rpx;"></view>
<input type="text"
:placeholder="subCurr!=1 || (subCurr==1 && tabsCurr!=2) ? '搜索您需要批发进货的产品名称': '搜索店铺名称'"
:value="where.keyword" placeholder-style="font-size: 30rpx;color:#999;" disabled
style="pointer-events: none;">
</view>
</view>
<!-- 综合查询 -->
<view class="comprehensive" v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
<view class="comprehensive-price" :class="{'comp-color': orderCurr==1}" @click="toOrder('price', 1)">
<text>价格</text>
<image v-if="orderCurr==1" style="width: 15rpx;height: 21rpx;"
:src="where.order == 'price_asc' ? domain+'/static/diy/up'+keyColor+'.png' : domain+'/static/diy/down'+keyColor+'.png'">
</image>
<view v-else style="width: 15rpx;height: 21rpx;"></view>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': orderCurr==2}"
@click="toOrder('sales', 2)">
<text>销量</text>
</view>
<view class="comprehensive-discount" :class="{'comp-color': orderCurr==3}" v-if="tabsCurr!=1"
@click="toOrder('', 3)">
<text>综合</text>
</view>
<!-- 商品大分类 -->
<view class="category">
<scroll-view scroll-x="true">
<view class="category-wrap">
<block v-for="(item,index) in store_category" :key="index">
<view class="category-item" :class="{'category-item-active': index==cate_change}"
@click="changeCate(index)">
<block v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
<u--image class="category-item-img" width="108rpx" :src="item.pic"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.cate_name}}</text>
</block>
<block v-else>
<u--image class="category-item-img" width="108rpx" :src="item.background"
height="108rpx" shape="circle">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<text class="category-item-text">{{item.category_name}}</text>
</block>
</view>
</block>
</view>
</scroll-view>
<view class="category-all" v-if="store_category.length > 0" @click="onAllCategory">
<view style="margin-bottom: 20rpx;">全部</view>
<u-icon name="list"></u-icon>
</view>
<view class="comprehensive-discount" v-else @click="onChangeDeductionRate">
<text>抵扣</text>
<image class="loudou" src="@/static/new_define/loudou.png"></image>
</view>
</view>
<!-- 商品小分类 -->
<view class="cate" v-if="store_category_children.length>1">
<scroll-view scroll-x="true">
<view class="cate-wrap">
<block v-for="(item,index) in store_category_children" :key="index">
<view class="cate-item" :class="{'cate-item-active':index == cate_change_children}"
@click="changeChildrenCate(index)">
<text>{{item.cate_name}}</text>
</view>
</block>
</view>
</scroll-view>
<!-- 综合查询 -->
<view class="comprehensive" v-if="deduction_rate && tabsCurr==1">
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate==''}"
@click="changeDeduction('')">
<text>全部</text>
</view>
<!-- 综合查询 -->
<view class="comprehensive" v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)">
<view class="comprehensive-price" :class="{'comp-color': orderCurr==1}"
@click="toOrder('price', 1)">
<text>价格</text>
<image v-if="orderCurr==1" style="width: 15rpx;height: 21rpx;"
:src="where.order == 'price_asc' ? domain+'/static/diy/up'+keyColor+'.png' : domain+'/static/diy/down'+keyColor+'.png'">
</image>
<view v-else style="width: 15rpx;height: 21rpx;"></view>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': orderCurr==2}"
@click="toOrder('sales', 2)">
<text>销量</text>
</view>
<view class="comprehensive-discount" :class="{'comp-color': orderCurr==3}" v-if="tabsCurr!=1"
@click="toOrder('', 3)">
<text>综合</text>
</view>
<view class="comprehensive-discount" v-else @click="deduction_rate=!deduction_rate;">
<text>抵扣</text>
<image class="loudou" src="@/static/new_define/loudou.png"></image>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='10'}"
@click="changeDeduction('10')">
<text>1:9</text>
</view>
<!-- 综合查询 -->
<view class="comprehensive" v-if="deduction_rate && tabsCurr==1">
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate==''}"
@click="changeDeduction('')">
<text>全部</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='10'}"
@click="changeDeduction('10')">
<text>1:9</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='15'}"
@click="changeDeduction('15')">
<text>2:8</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='20'}"
@click="changeDeduction('20')">
<text>3:7</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='25'}"
@click="changeDeduction('25')">
<text>4:6</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='15'}"
@click="changeDeduction('15')">
<text>2:8</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='20'}"
@click="changeDeduction('20')">
<text>3:7</text>
</view>
<view class="comprehensive-sales_num" :class="{'comp-color': where.deduction_rate=='25'}"
@click="changeDeduction('25')">
<text>4:6</text>
</view>
</view>
</view>
<!-- 内容 -->
<view class="wholeSale-con"
:style="{height:'calc(100vh - '+wrapHeight+'rpx - 142rpx '+(isShowSmall?' - 48rpx':'')+')'}">
<scroll-view :scroll-y="true" @scrolltolower="onScrollBottom" @scroll="onScroll" style="height: 100%;"
:refresher-enabled="true" :refresher-triggered="isTriggered" @refresherpulling="onPulling"
@refresherrefresh="onRefresh" :refresher-threshold="45" :scroll-anchoring='true'>
<!-- 流水瀑布 -->
<WaterfallsFlow v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)" :wfList='hostProduct'
@itemTap="goDetail" :type="0" :sale_type="2" />
<view class="wholeSale-con">
<!-- 流水瀑布 -->
<WaterfallsFlow v-if="subCurr!=1 || (subCurr==1 && tabsCurr!=2)" :wfList='hostProduct' @itemTap="goDetail"
:type="0" :sale_type="2" />
<!-- 列表 -->
<view class="goods_list" v-else>
<view class="goods" v-for="(item, index) in shopList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar">
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
<!-- 列表 -->
<view class="goods_list" v-else>
<view class="goods" v-for="(item, index) in shopList" :key="index" @click="goStore(item.mer_id)">
<view class="avatar">
<u--image width="160rpx" height="160rpx" :src="item.mer_avatar" mode="aspectFill">
<template v-slot:loading>
<u-loading-icon color="#999" size="15" />
</template>
</u--image>
</view>
<view class="content">
<view class="content-head">
<view class="title">{{item.mer_name}}</view>
<text style="font-size: 21.03rpx;color: #aaa;"
v-if="item.sales>=100">月销{{item.sales}}</text>
</view>
<view class="content">
<view class="content-head">
<view class="title">{{item.mer_name}}</view>
<text style="font-size: 21.03rpx;color: #aaa;"
v-if="item.sales>=100">月销{{item.sales}}</text>
</view>
<view class="content-two">
<view class="score">
<view class="star">
<view
:style="{width: `${(item.service_score / 5 * 100).toFixed(0)}%`, backgroundImage: `url(${domain}/static/diy/score1${keyColor}.png)`}">
</view>
<view class="content-two">
<view class="score">
<view class="star">
<view
:style="{width: `${(item.service_score / 5 * 100).toFixed(0)}%`, backgroundImage: `url(${domain}/static/diy/score1${keyColor}.png)`}">
</view>
</view>
<text
style="margin-left: 20rpx;color: #FF6D20;font-size: 22.78rpx; ">{{item.service_score}}</text>
<text v-if="item.distance"
style="margin-left: 20rpx;font-size: 21.03rpx;color: #aaa;">{{item.distance}}</text>
</view>
<text
style="margin-left: 20rpx;color: #FF6D20;font-size: 22.78rpx; ">{{item.service_score}}</text>
<text v-if="item.distance"
style="margin-left: 20rpx;font-size: 21.03rpx;color: #aaa;">{{item.distance}}</text>
<text style="margin-left: 20rpx;" class="line1">{{item.category_name}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text> {{item.service_phone}}</text>
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true"
src="/static/images/GXSC/SJ.png" width="33.85rpx" height="33.85rpx"></u--image>
<text
v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text class="address">{{item.mer_address}}</text>
</view>
<text style="margin-left: 20rpx;" class="line1">{{item.category_name}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DH.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text> {{item.service_phone}}</text>
<u--image style="margin-left: 28rpx;" v-if="item.mer_take_time" :showLoading="true"
src="/static/images/GXSC/SJ.png" width="33.85rpx" height="33.85rpx"></u--image>
<text v-if="item.mer_take_time">{{item.mer_take_time[0]}}-{{item.mer_take_time[1]}}</text>
</view>
<view class="content-two">
<u--image :showLoading="true" src="/static/images/GXSC/DW.png" width="33.85rpx"
height="33.85rpx"></u--image>
<text class="address">{{item.mer_address}}</text>
</view>
</view>
</view>
</view>
<loadmore :type="isLoading" v-if="isLoading || hostProduct.length > 0" style="padding: 12rpx 0;">
</loadmore>
<view class='pictrue' v-if="!isLoading && hostProduct.length == 0">
<image :src="`${domain}/static/images/noCart.png`"></image>
<view>暂无商品看点别的吧</view>
</view>
</scroll-view>
<loadmore :type="isLoading" v-if="isLoading || hostProduct.length > 0" style="padding: 12rpx 0;">
</loadmore>
<view class='pictrue' v-if="!isLoading && hostProduct.length == 0">
<image :src="`${domain}/static/images/noCart.png`"></image>
<view>暂无商品看点别的吧</view>
</view>
</view>
<!-- 弹框大分类 -->
@ -320,10 +315,9 @@
bigTypeDomInfo: null,
smallTypeDomInfo: null,
categoryWrapHeight: 0,
wrapHeight: 332,
isShowSmall: false,
scrollTop: 0,
isTriggered: false
wrapHeight: 360,
touchstarty: 0,
scrollIndex: ''
}
},
computed: {
@ -366,54 +360,54 @@
index: 1,
text: "批发",
selectedIconPath: "/static/tabbar_icon/b-a.png"
})
});
}
},
watch: {
'where.cate_pid'(newVal, oldVal) {
if (newVal && !oldVal) {
this.wrapHeight = this.tabsCurr == 2 ? 400 : (332 + 48);
this.isShowSmall = true;
}
if (!newVal && oldVal) {
this.wrapHeight = this.tabsCurr == 2 ? 400 : 332;
this.isShowSmall = false;
}
}
// watch: {
// 'where.cate_pid'(newVal, oldVal) {
// if (newVal && !oldVal) {
// this.isShowSmall = true;
// }
// if (!newVal && oldVal) {
// this.isShowSmall = false;
// }
// }
// },
onPullDownRefresh() {
this.initData(true, true);
},
onReachBottom() {
this.initData(false, true);
},
methods: {
//
onPulling() {
if (!this.isTriggered) {
this.isTriggered = true;
this.initData(true, true);
}
},
onRefresh(e) {
this.isTriggered = true;
//
onTouchStart(e) {
this.touchstarty = e.touches[0].clientY;
},
onScrollBottom(e) {
this.initData(false, true);
//
onTouchMove(e) {
this.$nextTick(() => {
let deltaY = e.changedTouches[0].clientY - this.touchstarty;
if (deltaY <= 0) {
console.log("上滑")
this.wrapHeight = 0;
} else {
console.log('下滑');
this.getHeight();
}
this.$forceUpdate();
})
},
onAllCategory() {
this.$refs.popup.open();
},
onScroll(e) {
if (this.scrollTop >= e.target.scrollTop) { //
this.wrapHeight = this.tabsCurr == 2 ? 400 : 332;
if (this.where.cate_pid) this.wrapHeight = this.wrapHeight + 48;
} else {
this.wrapHeight = 0;
}
this.scrollTop = e.target.scrollTop;
},
initData(re = false, stop = false) {
if (!stop) this.getStoreCategory();
if (this.tabsCurr == 2 && this.subCurr == 1) this.storeMerchantList(re, stop);
@ -435,6 +429,7 @@
this.cate_change = 0;
this.cate_change_children = 0;
this.initData(true);
this.getHeight()
},
toOrder(type, index = -1) {
if (this.where.order == type) {
@ -484,9 +479,58 @@
this.cate_change = 0;
this.cate_change_children = 0;
if (this.tabsCurr != 2 || (this.tabsCurr == 2 && this.subCurr != 1)) this.where.mer_type = e;
this.wrapHeight = this.tabsCurr == 2 ? 400 : this.where.cate_pid ? (332 + 48) : 332;
this.getHeight();
this.initData(true);
},
//
getHeight() {
console.log(this.store_category_children);
if (this.tabsCurr == 1) {
if (this.where.cate_pid) {
if (this.deduction_rate) {
this.wrapHeight = 460;
} else {
this.wrapHeight = 410;
}
} else {
if (this.deduction_rate) {
this.wrapHeight = 410;
} else {
this.wrapHeight = 360;
}
}
// if (this.store_category_children.length > 1 && this.deduction_rate) {
// this.wrapHeight = 460;
// } else if (this.store_category_children.length == 1 || !this.deduction_rate) {
// this.wrapHeight = 410;
// } else {
// if (this.cate_change || this.deduction_rate) {
// this.wrapHeight = 410;
// } else {
// this.wrapHeight = 360;
// }
// }
} else if (this.tabsCurr == 2) {
if (this.subCurr == 1) {
this.wrapHeight = 400;
} else {
this.wrapHeight = 440;
}
} else {
this.wrapHeight = 360;
}
},
onChangeDeductionRate() {
this.deduction_rate = !this.deduction_rate;
this.getHeight()
},
changeCate(e) {
this.cate_change = e;
this.store_category_children = [];
@ -507,8 +551,14 @@
this.where.cate_pid = this.store_category[e].store_category_id;
this.where.cate_id = "";
}
this.getProductslist(true);
this.getHeight();
// scrollView
this.scrollIndex = 'scroll' + e;
// popup
this.$refs.popup && this.$refs.popup.close();
},
@ -564,9 +614,9 @@
if (this.where.order) this.where.rand = 0;
else this.where.rand = 1;
getProductslist(this.where, true).then(res => {
uni.stopPullDownRefresh();
this.where.limit = res.data.limit
this.where.page = res.data.page
this.isTriggered = false;
if (reLoad) this.hostProduct = [];
this.hostProduct = [...this.hostProduct, ...res.data.list];
this.isLoading = 0;
@ -583,7 +633,6 @@
if (this.isLoading == -1) return;
this.isLoading = 1;
storeMerchantList(this.where).then(res => {
this.isTriggered = false;
this.shopList = [...this.shopList, ...res.data.list];
this.isLoading = 0;
if (res.data.list.length < this.where.limit) this.isLoading = -1;
@ -627,23 +676,11 @@
.wholeSale {
.wholeSale-header {
position: sticky;
position: fixed;
top: 0;
z-index: 90;
margin-bottom: 20rpx;
.wholeSale-header-wrap {
background-color: #40AE36;
}
.wholeSale-header-search-wrap {
position: sticky;
top: calc(82rpx + var(--status-bar-height));
transition: height .5s;
overflow: hidden;
padding: 30rpx 20rpx 0;
background-color: #fff;
}
background-color: #40AE36;
width: 100%;
.scrollview {
display: flex;
@ -678,43 +715,59 @@
}
}
.wholeSale-header-search-wrap {
position: fixed;
top: calc(98rpx + var(--status-bar-height));
z-index: 89;
width: 100%;
transition: height .5s;
overflow: hidden;
padding: 0rpx 20rpx;
background-color: #fff;
}
.wholeSale-con {
position: relative;
z-index: index;
margin: 0 10px;
}
.search_content {
margin-bottom: 40rpx;
height: 70rpx;
padding: 2px 2px 2px 21.05rpx;
border-radius: 80rpx;
background: #EDEFF2;
position: relative;
box-sizing: border-box;
.wholeSale-nav {
padding: 20rpx 0;
.search_content_wrap {
width: 100%;
.search_content {
height: 70rpx;
padding: 2px 2px 2px 21.05rpx;
border-radius: 80rpx;
background: #EDEFF2;
position: relative;
box-sizing: border-box;
.icon-sousuo {
font-size: 26.32rpx;
font-weight: bold;
color: #c8c7c6;
margin-right: 17.54rpx;
.search_content_wrap {
width: 100%;
.icon-sousuo {
font-size: 26.32rpx;
font-weight: bold;
color: #c8c7c6;
margin-right: 17.54rpx;
}
input {
width: 80%;
}
}
input {
width: 80%;
.search_btn {
width: 106rpx;
height: 60rpx;
line-height: 60rpx;
background: #40AE36;
border-radius: 100px;
font-size: 28rpx;
color: #fff;
}
}
.search_btn {
width: 106rpx;
height: 60rpx;
line-height: 60rpx;
background: #40AE36;
border-radius: 100px;
font-size: 28rpx;
color: #fff;
}
}
.category {
@ -774,23 +827,22 @@
top: 50%;
transform: translateY(-50%);
height: 100%;
background-color: #f3f3f3;
z-index: 10;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
font-size: 24rpx;
border-radius: 4rpx;
width: 70rpx;
color: #919191;
box-shadow: 0px 0px 60rpx #c5c5c5;
}
}
.cate {
width: 100%;
overflow: auto;
margin-bottom: 30rpx;
// margin-bottom: 30rpx;
.cate-wrap {
display: flex;
@ -883,7 +935,7 @@
display: flex;
justify-content: space-between;
align-items: center;
padding: 20rpx 50rpx;
padding: 10rpx 50rpx;
[class^=comprehensive-] {
display: flex;

View File

@ -1,249 +1,249 @@
// 权限说明
const state = {
WRITE_EXTERNAL_STORAGE: false,
READ_EXTERNAL_STORAGE: false,
CAMERA: false,
CALL_PHONE: false,
ACCESS_FINE_LOCATION: false,
/* #ifdef APP-PLUS */
isIos: plus.os.name == "iOS",
/* #endif */
mapping: {
'WRITE_EXTERNAL_STORAGE': {
title: "存储空间/照片权限说明",
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
methods: 'SET_WRITE_EXTERNAL_STORAGE'
},
'READ_EXTERNAL_STORAGE': {
title: "存储空间/照片权限说明",
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
methods: 'SET_READ_EXTERNAL_STORAGE'
},
'CAMERA': {
title: "相机/存储空间/照片权限说明",
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、扫描二维码、与客服沟通等场景中读取和写入相册和文件内容。",
methods: 'SET_CAMERA'
},
'CALL_PHONE': {
title: "拨打/管理电话权限说明",
content: "便于您使用该功能联系商家或者商家与您联系等场景",
methods: 'SET_CALL_PHONE'
},
'ACCESS_FINE_LOCATION': {
title: "获取位置权限说明",
content: "便于您使用该功能查看附近店铺/附近商品/店铺所在位置等场景",
methods: 'SET_ACCESS_FINE_LOCATION'
}
}
WRITE_EXTERNAL_STORAGE: false,
READ_EXTERNAL_STORAGE: false,
CAMERA: false,
CALL_PHONE: false,
ACCESS_FINE_LOCATION: false,
/* #ifdef APP-PLUS */
isIos: plus.os.name == "iOS",
/* #endif */
mapping: {
'WRITE_EXTERNAL_STORAGE': {
title: "存储空间/照片权限说明",
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
methods: 'SET_WRITE_EXTERNAL_STORAGE'
},
'READ_EXTERNAL_STORAGE': {
title: "存储空间/照片权限说明",
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、与客服沟通等场景中读取和写入相册和文件内容。",
methods: 'SET_READ_EXTERNAL_STORAGE'
},
'CAMERA': {
title: "相机/存储空间/照片权限说明",
content: "便于您使用该功能上传您的照片/图片/视频及用于更换头像、发布评论/分享、下载、扫描二维码、与客服沟通等场景中读取和写入相册和文件内容。",
methods: 'SET_CAMERA'
},
'CALL_PHONE': {
title: "拨打/管理电话权限说明",
content: "便于您使用该功能联系商家或者商家与您联系等场景",
methods: 'SET_CALL_PHONE'
},
'ACCESS_FINE_LOCATION': {
title: "获取位置权限说明",
content: "便于您使用该功能查看附近店铺/附近商品/店铺所在位置等场景",
methods: 'SET_ACCESS_FINE_LOCATION'
}
}
}
const mutations = {
SET_WRITE_EXTERNAL_STORAGE(state, val) {
state.WRITE_EXTERNAL_STORAGE = val
},
SET_CALL_PHONE(state, val) {
state.CALL_PHONE = val
},
SET_READ_EXTERNAL_STORAGE(state, val) {
state.READ_EXTERNAL_STORAGE = val
},
SET_CAMERA(state, val) {
state.CAMERA = val
},
SET_ACCESS_FINE_LOCATION(state, val) {
state.ACCESS_FINE_LOCATION = val
},
SET_WRITE_EXTERNAL_STORAGE(state, val) {
state.WRITE_EXTERNAL_STORAGE = val
},
SET_CALL_PHONE(state, val) {
state.CALL_PHONE = val
},
SET_READ_EXTERNAL_STORAGE(state, val) {
state.READ_EXTERNAL_STORAGE = val
},
SET_CAMERA(state, val) {
state.CAMERA = val
},
SET_ACCESS_FINE_LOCATION(state, val) {
state.ACCESS_FINE_LOCATION = val
},
}
const actions = {
//权限获取
async requestPermissions({
state,
dispatch,
commit
}, permissionID) {
try {
if (!state[permissionID] && !state.isIos) {
var viewObj = await dispatch('nativeObjView', permissionID);
viewObj.show();
}
console.log('android.permission.' + permissionID, '当前手机权限');
return new Promise(async (resolve, reject) => {
//苹果不需要这个
if(state.isIos){
resolve(1);
return
}
// Android权限查询
function requestAndroidPermission(permissionID_) {
return new Promise((resolve, reject) => {
plus.android.requestPermissions(
[
permissionID_
], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
function (resultObj) {
var result = 0;
for (var i = 0; i < resultObj.granted.length; i++) {
var grantedPermission = resultObj.granted[i];
console.log('已获取的权限:' + grantedPermission);
result = 1
}
for (var i = 0; i < resultObj.deniedPresent
.length; i++) {
var deniedPresentPermission = resultObj
.deniedPresent[
i];
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0
}
for (var i = 0; i < resultObj.deniedAlways
.length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[
i];
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1
}
resolve(result);
},
function (error) {
console.log('申请权限错误:' + error.code + " = " + error
.message);
resolve({
code: error.code,
message: error.message
});
}
);
});
}
const result = await requestAndroidPermission(
'android.permission.' + permissionID
);
if (result === 1) {
//'已获得授权'
commit(state.mapping[permissionID].methods, true)
} else if (result === 0) {
//'未获得授权'
commit(state.mapping[permissionID].methods, false)
} else {
commit(state.mapping[permissionID].methods, true)
uni.showModal({
title: '提示',
content: '操作权限已被拒绝,请手动前往设置',
confirmText: "立即设置",
success: (res) => {
if (res.confirm) {
dispatch('gotoAppPermissionSetting')
}
}
})
}
if (viewObj) viewObj.close()
resolve(result);
});
} catch (error) {
console.log(error);
reject(error);
}
},
//提示框
nativeObjView({
state
}, permissionID) {
const systemInfo = uni.getSystemInfoSync();
const statusBarHeight = systemInfo.statusBarHeight;
const navigationBarHeight = systemInfo.platform === 'android' ? 48 :
44; // Set the navigation bar height based on the platform
const totalHeight = statusBarHeight + navigationBarHeight;
let view = new plus.nativeObj.View('per-modal', {
top: '0px',
left: '0px',
width: '100%',
backgroundColor: '#444',
//opacity: .5;
})
view.drawRect({
color: '#fff',
radius: '5px'
}, {
top: totalHeight + 'px',
left: '5%',
width: '90%',
height: "100px",
})
view.drawText(state.mapping[permissionID].title, {
top: totalHeight + 5 + 'px',
left: "8%",
height: "30px"
}, {
align: "left",
color: "#000",
}, {
onClick: function (e) {
console.log(e);
}
})
view.drawText(state.mapping[permissionID].content, {
top: totalHeight + 35 + 'px',
height: "60px",
left: "8%",
width: "84%"
}, {
whiteSpace: 'normal',
size: "14px",
align: "left",
color: "#656563"
})
function show() {
view = plus.nativeObj.View.getViewById('per-modal');
view.show()
view = null//展示的时候也得清空,不然影响下次的关闭,不知道为啥
}
function close() {
view = plus.nativeObj.View.getViewById('per-modal');
view.close();
view = null
}
return {
show,
close
}
},
// 跳转到**应用**的权限页面
gotoAppPermissionSetting({
state
}) {
if (state.isIos) {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
// console.log(plus.device.vendor);
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
}
//权限获取
async requestPermissions({
state,
dispatch,
commit
}, permissionID) {
try {
if (!state[permissionID] && !state.isIos) {
var viewObj = await dispatch('nativeObjView', permissionID);
viewObj.show();
}
console.log('android.permission.' + permissionID, '当前手机权限');
return new Promise(async (resolve, reject) => {
//苹果不需要这个
if (state.isIos) {
resolve(1);
return
}
// Android权限查询
function requestAndroidPermission(permissionID_) {
return new Promise((resolve, reject) => {
plus.android.requestPermissions(
[
permissionID_
], // 理论上支持多个权限同时查询,但实际上本函数封装只处理了一个权限的情况。有需要的可自行扩展封装
function(resultObj) {
var result = 0;
for (var i = 0; i < resultObj.granted.length; i++) {
var grantedPermission = resultObj.granted[i];
console.log('已获取的权限:' + grantedPermission);
result = 1
}
for (var i = 0; i < resultObj.deniedPresent
.length; i++) {
var deniedPresentPermission = resultObj
.deniedPresent[
i];
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0
}
for (var i = 0; i < resultObj.deniedAlways
.length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[
i];
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1
}
resolve(result);
},
function(error) {
console.log('申请权限错误:' + error.code + " = " + error
.message);
resolve({
code: error.code,
message: error.message
});
}
);
});
}
const result = await requestAndroidPermission(
'android.permission.' + permissionID
);
if (result === 1) {
//'已获得授权'
commit(state.mapping[permissionID].methods, true)
} else if (result === 0) {
//'未获得授权'
commit(state.mapping[permissionID].methods, false)
} else {
commit(state.mapping[permissionID].methods, true)
// uni.showModal({
// title: '提示',
// content: '操作权限已被拒绝,请手动前往设置',
// confirmText: "立即设置",
// success: (res) => {
// if (res.confirm) {
// dispatch('gotoAppPermissionSetting')
// }
// }
// })
}
if (viewObj) viewObj.close()
resolve(result);
});
} catch (error) {
console.log(error);
reject(error);
}
},
//提示框
nativeObjView({
state
}, permissionID) {
const systemInfo = uni.getSystemInfoSync();
const statusBarHeight = systemInfo.statusBarHeight;
const navigationBarHeight = systemInfo.platform === 'android' ? 48 :
44; // Set the navigation bar height based on the platform
const totalHeight = statusBarHeight + navigationBarHeight;
let view = new plus.nativeObj.View('per-modal', {
top: '0px',
left: '0px',
width: '100%',
backgroundColor: '#444',
//opacity: .5;
})
view.drawRect({
color: '#fff',
radius: '5px'
}, {
top: totalHeight + 'px',
left: '5%',
width: '90%',
height: "100px",
})
view.drawText(state.mapping[permissionID].title, {
top: totalHeight + 5 + 'px',
left: "8%",
height: "30px"
}, {
align: "left",
color: "#000",
}, {
onClick: function(e) {
console.log(e);
}
})
view.drawText(state.mapping[permissionID].content, {
top: totalHeight + 35 + 'px',
height: "60px",
left: "8%",
width: "84%"
}, {
whiteSpace: 'normal',
size: "14px",
align: "left",
color: "#656563"
})
function show() {
view = plus.nativeObj.View.getViewById('per-modal');
view.show()
view = null //展示的时候也得清空,不然影响下次的关闭,不知道为啥
}
function close() {
view = plus.nativeObj.View.getViewById('per-modal');
view.close();
view = null
}
return {
show,
close
}
},
// 跳转到**应用**的权限页面
gotoAppPermissionSetting({
state
}) {
if (state.isIos) {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
// var setting2 = NSURL2.URLWithString("prefs:root=LOCATION_SERVICES");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
// console.log(plus.device.vendor);
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
}
}
export default {
namespaced: true,
state,
mutations,
actions
namespaced: true,
state,
mutations,
actions
};

View File

@ -11,243 +11,252 @@
var isIOS
function album() {
var result = 0;
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
var authStatus = PHPhotoLibrary.authorizationStatus();
if (authStatus === 0) {
result = null;
} else if (authStatus == 3) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(PHPhotoLibrary);
return result;
var result = 0;
var PHPhotoLibrary = plus.ios.import("PHPhotoLibrary");
var authStatus = PHPhotoLibrary.authorizationStatus();
if (authStatus === 0) {
result = null;
} else if (authStatus == 3) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(PHPhotoLibrary);
return result;
}
function camera() {
var result = 0;
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
if (authStatus === 0) {
result = null;
} else if (authStatus == 3) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(AVCaptureDevice);
return result;
var result = 0;
var AVCaptureDevice = plus.ios.import("AVCaptureDevice");
var authStatus = AVCaptureDevice.authorizationStatusForMediaType('vide');
if (authStatus === 0) {
result = null;
} else if (authStatus == 3) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(AVCaptureDevice);
return result;
}
function location() {
var result = 0;
var cllocationManger = plus.ios.import("CLLocationManager");
var enable = cllocationManger.locationServicesEnabled();
var status = cllocationManger.authorizationStatus();
if (!enable) {
result = 2;
} else if (status === 0) {
result = null;
} else if (status === 3 || status === 4) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(cllocationManger);
return result;
var result = 0;
var cllocationManger = plus.ios.import("CLLocationManager");
var enable = cllocationManger.locationServicesEnabled();
var status = cllocationManger.authorizationStatus();
if (!enable) {
result = 2;
} else if (status === 0) {
result = null;
} else if (status === 3 || status === 4) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(cllocationManger);
return result;
}
function push() {
var result = 0;
var UIApplication = plus.ios.import("UIApplication");
var app = UIApplication.sharedApplication();
var enabledTypes = 0;
if (app.currentUserNotificationSettings) {
var settings = app.currentUserNotificationSettings();
enabledTypes = settings.plusGetAttribute("types");
if (enabledTypes == 0) {
result = 0;
console.log("推送权限没有开启");
} else {
result = 1;
console.log("已经开启推送功能!")
}
plus.ios.deleteObject(settings);
} else {
enabledTypes = app.enabledRemoteNotificationTypes();
if (enabledTypes == 0) {
result = 3;
console.log("推送权限没有开启!");
} else {
result = 4;
console.log("已经开启推送功能!")
}
}
plus.ios.deleteObject(app);
plus.ios.deleteObject(UIApplication);
return result;
var result = 0;
var UIApplication = plus.ios.import("UIApplication");
var app = UIApplication.sharedApplication();
var enabledTypes = 0;
if (app.currentUserNotificationSettings) {
var settings = app.currentUserNotificationSettings();
enabledTypes = settings.plusGetAttribute("types");
if (enabledTypes == 0) {
result = 0;
console.log("推送权限没有开启");
} else {
result = 1;
console.log("已经开启推送功能!")
}
plus.ios.deleteObject(settings);
} else {
enabledTypes = app.enabledRemoteNotificationTypes();
if (enabledTypes == 0) {
result = 3;
console.log("推送权限没有开启!");
} else {
result = 4;
console.log("已经开启推送功能!")
}
}
plus.ios.deleteObject(app);
plus.ios.deleteObject(UIApplication);
return result;
}
function contact() {
var result = 0;
var CNContactStore = plus.ios.import("CNContactStore");
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
if (cnAuthStatus === 0) {
result = null;
} else if (cnAuthStatus == 3) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(CNContactStore);
return result;
var result = 0;
var CNContactStore = plus.ios.import("CNContactStore");
var cnAuthStatus = CNContactStore.authorizationStatusForEntityType(0);
if (cnAuthStatus === 0) {
result = null;
} else if (cnAuthStatus == 3) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(CNContactStore);
return result;
}
function record() {
var result = null;
var avaudiosession = plus.ios.import("AVAudioSession");
var avaudio = avaudiosession.sharedInstance();
var status = avaudio.recordPermission();
console.log("permissionStatus:" + status);
if (status === 1970168948) {
result = null;
} else if (status === 1735552628) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(avaudiosession);
return result;
var result = null;
var avaudiosession = plus.ios.import("AVAudioSession");
var avaudio = avaudiosession.sharedInstance();
var status = avaudio.recordPermission();
console.log("permissionStatus:" + status);
if (status === 1970168948) {
result = null;
} else if (status === 1735552628) {
result = 1;
} else {
result = 0;
}
plus.ios.deleteObject(avaudiosession);
return result;
}
function calendar() {
var result = null;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
if (ekAuthStatus == 3) {
result = 1;
console.log("日历权限已经开启");
} else {
console.log("日历权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
var result = null;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(0);
if (ekAuthStatus == 3) {
result = 1;
console.log("日历权限已经开启");
} else {
console.log("日历权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
}
function memo() {
var result = null;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
if (ekAuthStatus == 3) {
result = 1;
console.log("备忘录权限已经开启");
} else {
console.log("备忘录权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
var result = null;
var EKEventStore = plus.ios.import("EKEventStore");
var ekAuthStatus = EKEventStore.authorizationStatusForEntityType(1);
if (ekAuthStatus == 3) {
result = 1;
console.log("备忘录权限已经开启");
} else {
console.log("备忘录权限没有开启");
}
plus.ios.deleteObject(EKEventStore);
return result;
}
function requestIOS(permissionID) {
return new Promise((resolve, reject) => {
switch (permissionID) {
case "push":
resolve(push());
break;
case "location":
resolve(location());
break;
case "record":
resolve(record());
break;
case "camera":
resolve(camera());
break;
case "album":
resolve(album());
break;
case "contact":
resolve(contact());
break;
case "calendar":
resolve(calendar());
break;
case "memo":
resolve(memo());
break;
default:
resolve(0);
break;
}
});
return new Promise((resolve, reject) => {
switch (permissionID) {
case "push":
resolve(push());
break;
case "location":
resolve(location());
break;
case "record":
resolve(record());
break;
case "camera":
resolve(camera());
break;
case "album":
resolve(album());
break;
case "contact":
resolve(contact());
break;
case "calendar":
resolve(calendar());
break;
case "memo":
resolve(memo());
break;
default:
resolve(0);
break;
}
});
}
function requestAndroid(permissionID) {
return new Promise((resolve, reject) => {
plus.android.requestPermissions(
[permissionID],
function(resultObj) {
var result = 0;
for (var i = 0; i < resultObj.granted.length; i++) {
var grantedPermission = resultObj.granted[i];
console.log('已获取的权限:' + grantedPermission);
result = 1
}
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
var deniedPresentPermission = resultObj.deniedPresent[i];
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0
}
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[i];
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1
}
resolve(result);
},
function(error) {
console.log('result error: ' + error.message)
resolve({
code: error.code,
message: error.message
});
}
);
});
return new Promise((resolve, reject) => {
plus.android.requestPermissions(
[permissionID],
function(resultObj) {
var result = 0;
for (var i = 0; i < resultObj.granted.length; i++) {
var grantedPermission = resultObj.granted[i];
console.log('已获取的权限:' + grantedPermission);
result = 1
}
for (var i = 0; i < resultObj.deniedPresent.length; i++) {
var deniedPresentPermission = resultObj.deniedPresent[i];
console.log('拒绝本次申请的权限:' + deniedPresentPermission);
result = 0
}
for (var i = 0; i < resultObj.deniedAlways.length; i++) {
var deniedAlwaysPermission = resultObj.deniedAlways[i];
console.log('永久拒绝申请的权限:' + deniedAlwaysPermission);
result = -1
}
resolve(result);
},
function(error) {
console.log('result error: ' + error.message)
resolve({
code: error.code,
message: error.message
});
}
);
});
}
function gotoAppPermissionSetting() {
if (permission.isIOS) {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
if (permission.isIOS) {
var UIApplication = plus.ios.import("UIApplication");
var application2 = UIApplication.sharedApplication();
var NSURL2 = plus.ios.import("NSURL");
var setting2 = NSURL2.URLWithString("app-settings:");
application2.openURL(setting2);
plus.ios.deleteObject(setting2);
plus.ios.deleteObject(NSURL2);
plus.ios.deleteObject(application2);
} else {
var Intent = plus.android.importClass("android.content.Intent");
var Settings = plus.android.importClass("android.provider.Settings");
var Uri = plus.android.importClass("android.net.Uri");
var mainActivity = plus.android.runtimeMainActivity();
var intent = new Intent();
intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
intent.setData(uri);
mainActivity.startActivity(intent);
}
}
function isOpenGps() {
var context = plus.android.importClass("android.content.Context");
var locationManager = plus.android.importClass("android.location.LocationManager");
var main = plus.android.runtimeMainActivity();
var mainSvr = main.getSystemService(context.LOCATION_SERVICE);
return mainSvr.isProviderEnabled(locationManager.GPS_PROVIDER);
}
const permission = {
get isIOS(){
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios')
},
requestIOS: requestIOS,
requestAndroid: requestAndroid,
gotoAppSetting: gotoAppPermissionSetting
get isIOS() {
return typeof isIOS === 'boolean' ? isIOS : (isIOS = uni.getSystemInfoSync().platform === 'ios')
},
requestIOS: requestIOS,
requestAndroid: requestAndroid,
gotoAppSetting: gotoAppPermissionSetting,
isOpenGps
}
module.exports = permission
module.exports = permission

View File

@ -33,6 +33,30 @@ export default {
})
},
/*app
key:授权值
time:过期时间
*/
isOverTime: (key, time) => {
let FLAG = false;
const AUTH_TYPE = uni.getStorageSync(key);
// 当前时间
const CURR_TIME = +new Date();
if (!AUTH_TYPE) {
uni.setStorageSync(key, time + CURR_TIME);
FLAG = false;
} else {
// 判断两天时间是否过期
if (CURR_TIME < AUTH_TYPE) { //未过期
FLAG = false;
} else {
FLAG = true;
}
}
return FLAG;
},
//复制
uniCopy: ({
content,
@ -865,7 +889,9 @@ export default {
if (typeof list != 'object') return [];
if (sp === undefined) sp = [];
for (var i = 0; i < list.length; i++) {
sp.push(list[i]);
let product = sp.find(item => item.product_id == list[i].product_id);
if (!product)
sp.push(list[i]);
}
return sp;
},