Commit 3eaa2429 authored by 王建威's avatar 王建威

merge master

parents d3083f70 9034a2a3
No preview for this file type
import { php } from './host.js'; import { php } from './host.js';
import Clipboard from 'clipboard';
export function login() { export function login() {
location.href = php + 'app=member&act=login'; location.href = php + 'app=member&act=login';
...@@ -54,3 +55,25 @@ export function getCache (key){ ...@@ -54,3 +55,25 @@ export function getCache (key){
} }
} }
} }
// H5复制
export function handleClipboard (text, event, onSuccess, onError) {
event = event || {}
const clipboard = new Clipboard(event.target, {
text: () => text
})
clipboard.on('success', () => {
onSuccess()
clipboard.off('error')
clipboard.off('success')
clipboard.destroy()
})
clipboard.on('error', () => {
onError()
clipboard.off('error')
clipboard.off('success')
clipboard.destroy()
})
clipboard.onClick(event)
}
\ No newline at end of file
// 微信分享 公共方法 // 微信分享 公共方法
var jweixin = require('jweixin-module'); // var jweixin = require('jweixin-module');
export default { export default {
// 是否在微信中 // 是否在微信中
...@@ -22,7 +22,7 @@ export default { ...@@ -22,7 +22,7 @@ export default {
success: (res) => { success: (res) => {
const { data } = res; const { data } = res;
if(data.code === 0){ if(data.code === 0){
jweixin.config({ jWeixin.config({
debug: false, debug: false,
appId: data.data.appId, appId: data.data.appId,
timestamp: data.data.timestamp, timestamp: data.data.timestamp,
...@@ -59,7 +59,7 @@ export default { ...@@ -59,7 +59,7 @@ export default {
} }
//每次都需要重新初始化配置,才可以进行分享 //每次都需要重新初始化配置,才可以进行分享
this.initJssdkShare(function(){ this.initJssdkShare(function(){
jweixin.ready(function() { jWeixin.ready(function() {
var shareData = { var shareData = {
title: data && data.title ? data.title : '谛宝多多商城', title: data && data.title ? data.title : '谛宝多多商城',
desc: data && data.desc ? data.desc : '宠物行业一站式B2B采购平台', desc: data && data.desc ? data.desc : '宠物行业一站式B2B采购平台',
...@@ -72,14 +72,35 @@ export default { ...@@ -72,14 +72,35 @@ export default {
cancel: function(res) {} cancel: function(res) {}
}; };
//分享给朋友接口 //分享给朋友接口
jweixin.onMenuShareAppMessage(shareData); jWeixin.onMenuShareAppMessage(shareData);
//分享到朋友圈接口 //分享到朋友圈接口
jweixin.onMenuShareTimeline(shareData); jWeixin.onMenuShareTimeline(shareData);
// 分享到QQ // 分享到QQ
jweixin.onMenuShareQQ(shareData); jWeixin.onMenuShareQQ(shareData);
// 分享到微博 // 分享到微博
jweixin.onMenuShareWeibo(shareData); jWeixin.onMenuShareWeibo(shareData);
}); });
}, url); }, url);
},
// 向小程序发送分享的数据
postData: function(t){
// imgUrl: image || 'https://dbc-static.oss-cn-beijing.aliyuncs.com/wx/logo.jpg'
const postData = {
link: window.location.href,
title: t
}
jWeixin.miniProgram.postMessage({ data: JSON.stringify(postData) });
},
isMini: function(){
jWeixin.miniProgram.getEnv(function (res) {
//获取当前环境
if(res.miniprogram){
// true 在微信小程序中
return true;
}else{
// false 在微信公众号里
return false;
}
});
} }
} }
\ No newline at end of file
...@@ -22,8 +22,9 @@ ...@@ -22,8 +22,9 @@
<link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" /> <link rel="stylesheet" href="<%= BASE_URL %>static/index.<%= VUE_APP_INDEX_CSS_HASH %>.css" />
<script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script> <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.min.js"></script>
<script src="https://dbc-static.oss-cn-beijing.aliyuncs.com/dbc-shop/lib/draggabilly.min.js"></script> <script src="https://dbc-static.oss-cn-beijing.aliyuncs.com/dbc-shop/lib/draggabilly.min.js"></script>
<script src="https://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<!-- WPA start --> <!-- WPA start -->
<script id="qd28857712162361a518c852fc82fde1e5eab730ba68" src="https://wp.qiye.qq.com/qidian/2885771216/2361a518c852fc82fde1e5eab730ba68" charset="utf-8" async defer></script> <!-- <script id="qd28857712162361a518c852fc82fde1e5eab730ba68" src="https://wp.qiye.qq.com/qidian/2885771216/2361a518c852fc82fde1e5eab730ba68" charset="utf-8" async defer ></script> -->
<!-- WPA end --> <!-- WPA end -->
</head> </head>
<body> <body>
...@@ -31,7 +32,7 @@ ...@@ -31,7 +32,7 @@
<strong>Please enable JavaScript to continue.</strong> <strong>Please enable JavaScript to continue.</strong>
</noscript> </noscript>
<div id="app"></div> <div id="app"></div>
<div class='draggable is-pointer-down is-dragging' id='qidian_dom'><span></span></div> <div class="draggable is-pointer-down is-dragging" id="qidian_dom" style="display: none;"><span></span></div>
<script> <script>
var _hmt = _hmt || []; var _hmt = _hmt || [];
(function() { (function() {
...@@ -40,6 +41,38 @@ ...@@ -40,6 +41,38 @@
var s = document.getElementsByTagName("script")[0]; var s = document.getElementsByTagName("script")[0];
s.parentNode.insertBefore(hm, s); s.parentNode.insertBefore(hm, s);
})(); })();
const ua = window.navigator.userAgent.toLowerCase();
if (ua.match(/micromessenger/i) == 'micromessenger') {
isMiniProgram();
} else {
const dom = document.getElementById('qidian_dom');
dom.style.display = 'block';
const script_dom = document.createElement('script');
script_dom.src = "https://wp.qiye.qq.com/qidian/2885771216/2361a518c852fc82fde1e5eab730ba68";
script_dom.language = 'javascript';
script_dom.id = 'qd28857712162361a518c852fc82fde1e5eab730ba68';
script_dom.type = 'text/javascript';
const head = document.getElementsByTagName('head').item(0);//这个是往本页面动态加载js脚本
head.appendChild(script_dom);
}
function isMiniProgram(){
jWeixin.miniProgram.getEnv(function (res) {
//获取当前环境
const dom = document.getElementById('qidian_dom');
if(res.miniprogram){
dom.style.display = 'none';
}else{
dom.style.display = 'block';
const script_dom = document.createElement('script');
script_dom.src = "https://wp.qiye.qq.com/qidian/2885771216/2361a518c852fc82fde1e5eab730ba68";
script_dom.language = 'javascript';
script_dom.id = 'qd28857712162361a518c852fc82fde1e5eab730ba68';
script_dom.type = 'text/javascript';
const head = document.getElementsByTagName('head').item(0);//这个是往本页面动态加载js脚本
head.appendChild(script_dom);
}
});
}
var $draggable = $('.draggable').draggabilly({ var $draggable = $('.draggable').draggabilly({
containment: true containment: true
......
...@@ -13,9 +13,10 @@ import { ...@@ -13,9 +13,10 @@ import {
// 微信分享公共接口 // 微信分享公共接口
// #ifdef H5 // #ifdef H5
import wechat from './common/wechat.js'; import wechat from './common/wechat.js';
if (wechat.isWechat()) { Vue.prototype.$wechat = wechat;
Vue.prototype.$wechat = wechat; // if (wechat.isWechat() || wechat.isMini()) {
} // Vue.prototype.$wechat = wechat;
// }
// #endif // #endif
Vue.config.productionTip = false; Vue.config.productionTip = false;
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
"name": "shop_mobile_uni", "name": "shop_mobile_uni",
"appid": "__UNI__F904656", "appid": "__UNI__F904656",
"description": "", "description": "",
"versionName": "1.0.13", "versionName": "1.0.15",
"versionCode": "100", "versionCode": "100",
"transformPx": false, "transformPx": false,
"app-plus": { "app-plus": {
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
"mode": "history", "mode": "history",
"base": "/uni" "base": "/uni"
}, },
"publicPath": "https://dbc-static.oss-cn-beijing.aliyuncs.com/dbc-shop/uni/test/1.0.13/", "publicPath": "https://dbc-static.oss-cn-beijing.aliyuncs.com/dbc-shop/uni/test/1.0.15/",
"optimization": { "optimization": {
"treeShaking": { "treeShaking": {
"enable": true "enable": true
...@@ -62,7 +62,7 @@ ...@@ -62,7 +62,7 @@
"disableHostCheck": true, "disableHostCheck": true,
"proxy": { "proxy": {
"/uni/api": { "/uni/api": {
"target": "http://10.0.0.52:6564/", "target": "http://39.96.85.45:9093/",
"changeOrigin": true, "changeOrigin": true,
"secure": false, "secure": false,
"pathRewrite": { "pathRewrite": {
......
{ {
"name": "shop_mobile_uni", "name": "shop_mobile_uni",
"version": "1.0.7", "version": "1.0.13",
"lockfileVersion": 1, "lockfileVersion": 1,
"requires": true, "requires": true,
"dependencies": { "dependencies": {
...@@ -562,6 +562,16 @@ ...@@ -562,6 +562,16 @@
} }
} }
}, },
"clipboard": {
"version": "2.0.6",
"resolved": "https://registry.npmjs.org/clipboard/-/clipboard-2.0.6.tgz",
"integrity": "sha512-g5zbiixBRk/wyKakSwCKd7vQXDjFnAMGHoEyBogG/bw9kTD9GvdAvaoRR1ALcEzt3pVKxZR0pViekPMIS0QyGg==",
"requires": {
"good-listener": "^1.2.2",
"select": "^1.1.2",
"tiny-emitter": "^2.0.0"
}
},
"cliui": { "cliui": {
"version": "3.2.0", "version": "3.2.0",
"resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz", "resolved": "https://registry.npmjs.org/cliui/-/cliui-3.2.0.tgz",
...@@ -821,6 +831,11 @@ ...@@ -821,6 +831,11 @@
} }
} }
}, },
"delegate": {
"version": "3.2.0",
"resolved": "https://registry.npmjs.org/delegate/-/delegate-3.2.0.tgz",
"integrity": "sha512-IofjkYBZaZivn0V8nnsMJGBr4jVLxHDheKSW88PyxS5QC4Vo9ZbZVvhzlSxY87fVq3STR6r+4cGepyHkcWOQSw=="
},
"detect-file": { "detect-file": {
"version": "1.0.0", "version": "1.0.0",
"resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz", "resolved": "https://registry.npmjs.org/detect-file/-/detect-file-1.0.0.tgz",
...@@ -1932,6 +1947,14 @@ ...@@ -1932,6 +1947,14 @@
"sparkles": "^1.0.0" "sparkles": "^1.0.0"
} }
}, },
"good-listener": {
"version": "1.2.2",
"resolved": "https://registry.npmjs.org/good-listener/-/good-listener-1.2.2.tgz",
"integrity": "sha1-1TswzfkxPf+33JoNR3CWqm0UXFA=",
"requires": {
"delegate": "^3.1.2"
}
},
"graceful-fs": { "graceful-fs": {
"version": "4.2.3", "version": "4.2.3",
"resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.3.tgz",
...@@ -3469,6 +3492,11 @@ ...@@ -3469,6 +3492,11 @@
"integrity": "sha1-VjsZx8HeiS4Jv8Ty/DDjwn8JUrk=", "integrity": "sha1-VjsZx8HeiS4Jv8Ty/DDjwn8JUrk=",
"dev": true "dev": true
}, },
"select": {
"version": "1.1.2",
"resolved": "https://registry.npmjs.org/select/-/select-1.1.2.tgz",
"integrity": "sha1-DnNQrN7ICxEIUoeG7B1EGNEbOW0="
},
"semver": { "semver": {
"version": "5.7.1", "version": "5.7.1",
"resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz",
...@@ -3872,6 +3900,11 @@ ...@@ -3872,6 +3900,11 @@
"integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=", "integrity": "sha1-dkpaEa9QVhkhsTPztE5hhofg9cM=",
"dev": true "dev": true
}, },
"tiny-emitter": {
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
"integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q=="
},
"to-absolute-glob": { "to-absolute-glob": {
"version": "2.0.2", "version": "2.0.2",
"resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz",
......
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
"minimist": "^1.2.0" "minimist": "^1.2.0"
}, },
"dependencies": { "dependencies": {
"clipboard": "^2.0.6",
"jweixin-module": "^1.6.0", "jweixin-module": "^1.6.0",
"md5": "^2.2.1", "md5": "^2.2.1",
"moment": "^2.24.0" "moment": "^2.24.0"
......
...@@ -127,6 +127,12 @@ ...@@ -127,6 +127,12 @@
"navigationBarTitleText": "支付状态-谛宝多多商城" "navigationBarTitleText": "支付状态-谛宝多多商城"
} }
}, },
{
"path": "pages/logistics/logistics",
"style": {
"navigationBarTitleText": "物流查询-谛宝多多商城"
}
},
{ {
"path": "pages/setaccount/setaccount", "path": "pages/setaccount/setaccount",
"style": { "style": {
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
if (this.$wechat && this.$wechat.isWechat()) { if (this.$wechat && this.$wechat.isWechat()) {
this.$wechat.share({titie: this.$getNavigationBarTitle()}); this.$wechat.share({titie: this.$getNavigationBarTitle()});
} }
this.postData();
// #endif // #endif
}, },
onPullDownRefresh() { onPullDownRefresh() {
...@@ -97,6 +98,20 @@ ...@@ -97,6 +98,20 @@
goBack() { goBack() {
this.$backup(); this.$backup();
}, },
// 向小程序发送数据
postData(){
jWeixin.miniProgram.getEnv(function (res) {
//获取当前环境
if(res.miniprogram){
// this.$wechat.postData('谛宝多多商城-首页');
const postData = {
link: window.location.href,
title: '谛宝多多商城-首页'
}
jWeixin.miniProgram.postMessage({ data: JSON.stringify(postData) });
}
});
},
getData(params) { getData(params) {
uni.request({ uni.request({
url: '/uni/api/credit_goods/get_credit_second_goods', url: '/uni/api/credit_goods/get_credit_second_goods',
......
...@@ -75,6 +75,7 @@ ...@@ -75,6 +75,7 @@
if (this.$wechat && this.$wechat.isWechat()) { if (this.$wechat && this.$wechat.isWechat()) {
this.$wechat.share({titie: this.$getNavigationBarTitle()}); this.$wechat.share({titie: this.$getNavigationBarTitle()});
} }
this.postData();
// #endif // #endif
}, },
onPullDownRefresh() { onPullDownRefresh() {
...@@ -97,6 +98,20 @@ ...@@ -97,6 +98,20 @@
goBack() { goBack() {
this.$backup(); this.$backup();
}, },
// 向小程序发送数据
postData(){
jWeixin.miniProgram.getEnv(function (res) {
//获取当前环境
if(res.miniprogram){
// this.$wechat.postData('谛宝多多商城-首页');
const postData = {
link: window.location.href,
title: '谛宝多多商城'
}
jWeixin.miniProgram.postMessage({ data: JSON.stringify(postData) });
}
});
},
getData(params) { getData(params) {
uni.request({ uni.request({
url: '/uni/api/credit_goods/get_credit_all_goods', url: '/uni/api/credit_goods/get_credit_all_goods',
......
...@@ -98,6 +98,7 @@ ...@@ -98,6 +98,7 @@
if (this.$wechat && this.$wechat.isWechat()) { if (this.$wechat && this.$wechat.isWechat()) {
this.$wechat.share({titie: this.$getNavigationBarTitle()}); this.$wechat.share({titie: this.$getNavigationBarTitle()});
} }
this.postData();
// #endif // #endif
}, },
methods: { methods: {
...@@ -161,6 +162,20 @@ ...@@ -161,6 +162,20 @@
backHome(){ backHome(){
this.$jump('/pages/home/home', 2); this.$jump('/pages/home/home', 2);
}, },
// 向小程序发送数据
postData(){
jWeixin.miniProgram.getEnv(function (res) {
//获取当前环境
if(res.miniprogram){
// this.$wechat.postData('谛宝多多商城-首页');
const postData = {
link: window.location.href,
title: '谛宝多多商城'
}
jWeixin.miniProgram.postMessage({ data: JSON.stringify(postData) });
}
});
},
navigate(url) { navigate(url) {
uni.navigateTo({ uni.navigateTo({
url: url url: url
......
...@@ -70,6 +70,7 @@ ...@@ -70,6 +70,7 @@
if (this.$wechat && this.$wechat.isWechat()) { if (this.$wechat && this.$wechat.isWechat()) {
this.$wechat.share({titie: this.$getNavigationBarTitle()}); this.$wechat.share({titie: this.$getNavigationBarTitle()});
} }
this.postData();
// #endif // #endif
}, },
onPageScroll() { onPageScroll() {
...@@ -120,6 +121,20 @@ ...@@ -120,6 +121,20 @@
this.$jump(`${origin}/mobile/index.php?app=coupon&act=view&id=${this.COUPON_ID}`); this.$jump(`${origin}/mobile/index.php?app=coupon&act=view&id=${this.COUPON_ID}`);
this.$refs.popup.close(); this.$refs.popup.close();
}, },
// 向小程序发送数据
postData(){
jWeixin.miniProgram.getEnv(function (res) {
//获取当前环境
if(res.miniprogram){
// this.$wechat.postData('谛宝多多商城-首页');
const postData = {
link: window.location.href,
title: '谛宝多多商城-首页'
}
jWeixin.miniProgram.postMessage({ data: JSON.stringify(postData) });
}
});
},
get_coupon(reg_time){ get_coupon(reg_time){
// 打开广告弹窗 // 打开广告弹窗
const timestamp = new Date('2020/05/19 00:00:00').getTime() / 1000; const timestamp = new Date('2020/05/19 00:00:00').getTime() / 1000;
......
...@@ -122,6 +122,7 @@ ...@@ -122,6 +122,7 @@
if (this.$wechat && this.$wechat.isWechat()) { if (this.$wechat && this.$wechat.isWechat()) {
this.$wechat.share({titie: this.$getNavigationBarTitle()}); this.$wechat.share({titie: this.$getNavigationBarTitle()});
} }
this.postData();
// #endif // #endif
}, },
components: { components: {
...@@ -136,6 +137,20 @@ ...@@ -136,6 +137,20 @@
search() { search() {
window.location.href = `${php}app=search&act=index&keyword=${this.keyword}` window.location.href = `${php}app=search&act=index&keyword=${this.keyword}`
}, },
// 向小程序发送数据
postData(){
jWeixin.miniProgram.getEnv(function (res) {
//获取当前环境
if(res.miniprogram){
// this.$wechat.postData('谛宝多多商城-首页');
const postData = {
link: window.location.href,
title: '谛宝多多商城'
}
jWeixin.miniProgram.postMessage({ data: JSON.stringify(postData) });
}
});
},
changeCurrent(index) { changeCurrent(index) {
this.current = index; this.current = index;
}, },
......
This diff is collapsed.
...@@ -48,7 +48,7 @@ ...@@ -48,7 +48,7 @@
<view class="image-outer" @click="jumpPhpPage(`app=goods&id=${item._source.goods_id}`)"> <view class="image-outer" @click="jumpPhpPage(`app=goods&id=${item._source.goods_id}`)">
<image :src="item._source.default_image || $noGoodsImg" lazy-load @error="$__reloadResource(item)" mode="aspectFill"></image> <image :src="item._source.default_image || $noGoodsImg" lazy-load @error="$__reloadResource(item)" mode="aspectFill"></image>
</view> </view>
<view class="title">{{item._source.goods_name}}</view> <view class="title">{{item._source.brand}} {{item._source.goods_name}}</view>
<view class="sub-title">{{item._source.goods_subname}}</view> <view class="sub-title">{{item._source.goods_subname}}</view>
<view v-if="isLogin"> <view v-if="isLogin">
<view v-if="item._source.is_pro === 1"> <view v-if="item._source.is_pro === 1">
...@@ -111,6 +111,7 @@ ...@@ -111,6 +111,7 @@
if (this.$wechat && this.$wechat.isWechat()) { if (this.$wechat && this.$wechat.isWechat()) {
this.$wechat.share({titie: this.$getNavigationBarTitle()}); this.$wechat.share({titie: this.$getNavigationBarTitle()});
} }
this.postData();
// #endif // #endif
this.param = {...this.param, ...option}; this.param = {...this.param, ...option};
this.searchVal = option.keyword; this.searchVal = option.keyword;
...@@ -138,6 +139,20 @@ ...@@ -138,6 +139,20 @@
url: '/pages/home/home' url: '/pages/home/home'
}) })
}, },
// 向小程序发送数据
postData(){
jWeixin.miniProgram.getEnv(function (res) {
//获取当前环境
if(res.miniprogram){
// this.$wechat.postData('谛宝多多商城-首页');
const postData = {
link: window.location.href,
title: '谛宝多多商城'
}
jWeixin.miniProgram.postMessage({ data: JSON.stringify(postData) });
}
});
},
// 加入购物车 // 加入购物车
addCart(spec_id, quantity) { addCart(spec_id, quantity) {
this.$addCart(spec_id, quantity, this.isLogin); this.$addCart(spec_id, quantity, this.isLogin);
...@@ -180,7 +195,7 @@ ...@@ -180,7 +195,7 @@
if(type === 'refresh'){ if(type === 'refresh'){
this.goods_list = []; this.goods_list = [];
} }
this.goods_list = this.goods_list.concat(data.data); this.goods_list = this.goods_list.concat(data.data || []);
this.goods_list.map((item, key) => { this.goods_list.map((item, key) => {
if(item._source.is_pro === 1 && new Date(item._source.end_time).getTime() < new Date().getTime()) if(item._source.is_pro === 1 && new Date(item._source.end_time).getTime() < new Date().getTime())
item._source.is_pro = 0; item._source.is_pro = 0;
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
success: (res) => { success: (res) => {
const {data} = res; const {data} = res;
if(data.code == 0){ if(data.code == 0){
this.goods_names = data.data; this.goods_names = data.data || [];
} }
} }
}); });
......
No preview for this file type
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment