Commit 828b15c5 by huahua

更新代码

parent a6e04c53
......@@ -4,13 +4,13 @@
<view class="tool-item" v-for="(item, index) in toolArr" :key="index">
<block v-if="item.url === 'share'">
<button open-type="share" class="tool-btn">
<image class="icon" :src="item.select?item.selectIcon:item.icon" mode="aspectFit"></image>
<!-- <image class="icon" :src="item.select?item.selectIcon:item.icon" mode="aspectFit"></image> -->
<text class="title" :class="{'title-select': item.select}">{{item.title}}</text>
</button>
</block>
<block v-else>
<button @click="toolItemAction(index)" class="tool-btn">
<image class="icon" :src="item.select?item.selectIcon:item.icon" mode="aspectFit"></image>
<!-- <image class="icon" :src="item.select?item.selectIcon:item.icon" mode="aspectFit"></image> -->
<text class="title" :class="{'title-select': item.select}">{{item.title}}</text>
</button>
</block>
......@@ -23,23 +23,16 @@
<view style="width: 67upx;height: 67upx; display: flex; align-items: center; justify-content: center;"
:style="{ backgroundColor: item.color}"
@click="selectColor(item,index)">
<image v-if="index == selectColorIndex" src="../../static/mine/icon_confirm.png" mode=""
style="width: 31upx; height: 22upx;"></image>
<image v-if="index == selectColorIndex" src="../../static/mine/icon_confirm.png" mode="" style="width: 31upx; height: 22upx;"></image>
</view>
</view>
</scroll-view>
</view>
<view class="pen-section">
<view style="display: flex; align-items: center; justify-content: center;">
<!-- <view class="pen" :style="{backgroundColor: penColor, height: lineWidth}"></view>
<view class="triangle-right"
:style="{'border-top': (lineValue / 2) + 'px solid transparent',
'border-left': lineValue + 'px solid' + penColor,
'border-bottom': (lineValue / 2) + 'px solid transparent',}"></view> -->
<view style="font-size: 25upx; margin-right: 16upx; color: #FFFFFF;">画笔大小</view>
</view>
<slider min="1" max="20" :value="lineValue" block-size="25" activeColor="#FFFFFF" class="pen-slider" @change="penWidthChange"/>
<!-- <view class="pen-txt">{{lineWidth}}</view> -->
</view>
</view>
</template>
......@@ -592,7 +585,7 @@
}
},
methods: {
// 常用颜色选择
//常用颜色选择
selectColor(color,index) {
this.selectColorIndex = index
this.$emit('colorPickTap', color);
......@@ -601,7 +594,6 @@
this.$emit('toolItemTap', index);
},
penWidthChange (e) {
// console.log('滑块滚动:' + JSON.stringify(e));
this.lineWidth = e.detail.value + 'px';
this.lineValue = e.detail.value;
this.$emit('penWidthChange', this.lineValue);
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -15,9 +15,12 @@
"browserslist": "^4.14.1",
"build": "^0.1.4",
"caniuse-lite": "^1.0.30001124",
"crypto-js": "^4.1.1",
"echarts": "^4.9.0",
"element-ui": "^2.15.13",
"flyio": "^0.6.14",
"font-awesome": "^4.7.0",
"js-base64": "^3.7.5",
"js-md5": "^0.7.3",
"jssha": "^2.4.2",
"jweixin-module": "^1.6.0",
......@@ -29,8 +32,6 @@
"vuex": "^3.5.1"
},
"devDependencies": {
"webpack": "^3.12.0",
"webpack-cli": "^3.3.12",
"webpack-dev-server": "^2.11.5"
},
"repository": {
......
......@@ -36,8 +36,7 @@
"navigationBarTitleText": "色彩高尔夫"
}
}]
},
{
},{
"root": "pages/mall",
"pages": [
{
......@@ -49,30 +48,30 @@
}
}
]
},
{
},{
"root": "pages/mine",
"pages": [{
"path": "self_help_payment_details",
"style": {
"navigationBarTitleText": "打印",
"navigationStyle": "custom"
}
},
{
"path": "self_help_payment_details_new",
"style": {
"navigationBarTitleText": "打印",
"navigationStyle": "custom"
}
},
{
"path": "order",
"style": {
"navigationBarTitleText": "付款区"
}
}
]
}
]
"pages": [
// {
// "path": "self_help_payment_details",
// "style": {
// "navigationBarTitleText": "打印",
// "navigationStyle": "custom"
// }
// },
// {
// "path": "self_help_payment_details_new",
// "style": {
// "navigationBarTitleText": "打印",
// "navigationStyle": "custom"
// }
// },
// {
// "path": "order",
// "style": {
// "navigationBarTitleText": "付款区"
// }
// }
]
}
]
}
......@@ -21,9 +21,6 @@
style="width: 15upx; height: 15upx; margin-left: 10upx;"></image>
<image else src="../../static/icon_banner_select_dot.png"
style="width: 15upx; height: 15upx; margin-left: 10upx;"></image>
<!-- <view class="dot iconfont"
:class="[index == currentSwiper ? 'iconsanjiaoxing':'iconxingzhuang-sanjiaoxing' ]">
</view> -->
</view>
</view>
</view>
......@@ -33,12 +30,11 @@
background: linear-gradient(92deg, #F29F3D, #67C4CA);
box-shadow: 0px 19px 48px 1px rgba(20, 31, 62, 0.35);
border-radius: 40px;">
<view
style=" text-align: center; line-height: 100upx; font-size: 36upx; font-weight: 500; color: #FFFFFF;">
<view style=" text-align: center; line-height: 100upx; font-size: 36upx; font-weight: 500; color: #FFFFFF;">
立即定制</view>
</view>
</view>
<!-- 错误提示信息 -->
<view v-if="statusloading == 2" style="min-height: 100%;background: #131319 !important;">
<view class="start" style="padding-bottom: 100upx; padding-top: 200upx;">
......@@ -47,8 +43,7 @@
<view @click="tomakePhoneCall">
<view class="start_text">联系客服</view>
<view class="start_text" style="display: flex; justify-content: center; align-items: center;">
<image src="../../static/phone.png" mode=""
style="width: 32upx; height: 32upx; margin-right: 5upx;"></image>
<image src="../../static/phone.png" mode="" style="width: 32upx; height: 32upx; margin-right: 5upx;"></image>
{{phone || '18938664545'}}
</view>
</view>
......@@ -170,20 +165,11 @@
uni.login({
provider: 'weixin',
success: (res) => {
//console.log(res)
userService.login({
s: 'Init.init',
code: res.code
}).then(r => {
that.getDetail();
if (type == 1) {
that.$refs['switchGoods'].open(that.machine_id);
} else {
uni.navigateTo({
url: '../mall/lineUp?machine_id=' + that.machine_id +
'&key=' + that.key
})
}
that.$refs['switchGoods'].open(that.machine_id);
}).catch(err => {
that.$refs.Signin.init();
});
......@@ -223,7 +209,7 @@
this.msg = err.msg
this.statusloading = 2;
this.phone = err.data.phone || '18938664545'
this.myheadtext = '歇一歇' //头部标题栏
this.myheadtext = '歇一歇'
uni.stopPullDownRefresh();
uni.hideLoading();
});
......@@ -261,7 +247,7 @@
//分享转发
onShareAppMessage(options) {
var that = this;
// 设置转发内容
//设置转发内容
var shareObj = {
title: this.$Env.getmalltext(),
path: '/pages/mall/machineDetail?machine_id=' + this.machine_id, // 默认是当前页面,必须是以‘/’开头的完整路径
......@@ -280,7 +266,8 @@
this.myheadtext = this.machine_id + "-定制";
this.$base.machine_id = this.machine_id
this.statusloading = 1;
this.Adlist() // 轮播图
this.Adlist() //轮播图
this.getDetail() //获取数据
},
onShow() {},
......
<template>
<view class="full-width full-height">
<!-- v-if="system_config.golf_diy.value == 0" -->
<!-- v-if="system_config.golf_diy.value == 0" -->
<view v-if="system_config.lite_diy.value == 0" @tap="doubleTap" @touchstart="touchStart" @touchend="touchEnd"
style="position: fixed; z-index: 99; right: 0; bottom: 524upx; display: flex;align-items: center;justify-content: center;
width: 100upx; height: 88upx; background: #43cf7c; border-radius: 44upx 0px 0px 44upx;">
......@@ -29,6 +28,7 @@
</view>
<view style="color: #333333 ; font-weight: bold;font-size: 33upx;">开始扫码定制</view>
</view>
<!-- 登录弹框 -->
<Signin ref="Signin"></Signin>
</view>
......@@ -57,100 +57,6 @@
};
},
methods: {
// Uploadpictures(){
// var that = this
// wx.chooseMessageFile({
// count: 1,
// type: 'image',
// success(res) {
// console.log(res);
// // tempFilePath可以作为img标签的src属性显示图片
// let tempFilePaths = [];
// res.tempFiles.forEach(item => {
// tempFilePaths.push(item.path)
// })
// var size = res.tempFiles[0].size;
// var path = res.tempFiles[0].path;
// var formatImage = path.split(".")[(path.split(".")).length - 1];
// if (formatImage != "png" && formatImage != "jpg" && formatImage != "jpeg") {
// return wx.showToast({
// title: '只能上传.png、.jpg、.jpep 格式',
// icon: 'none',
// image: '',
// duration: 2000,
// mask: true,
// })
// }
// that.uploadDIY(tempFilePaths, 0, 0, 0, tempFilePaths.length);
// }
// })
// },
/* 函数描述:作为上传文件时递归上传的函数体体;
* 参数描述:
* filePaths是文件路径数组
* successUp是成功上传的个数->0
* failUp是上传失败的个数->0
* i是文件路径数组的指标->0
* length是文件路径数组的长度
* machine_id=user_id=
*/
// uploadDIY(tempFilePaths, successUp, failUp, i, length) {
// let machine_id = this.machine_id || 0
// let user_id = userService.getUserInfo().id || 0
// var _this = this
// wx.request({
// url: this.$Env.getDevBaseURL() + '/api/AliossSign/getSign?machine_id=' + machine_id + '&user_id=' + user_id,
// method: 'GET',
// data:'',
// header: {
// 'content-type':'application/x-www-form-urlencoded',
// 'Accept': 'application/json'
// },
// success: function (res) {
// //这里是进度条
// _this.percent = 0
// var atter = res.data
// let time = new Date().getTime() + Math.floor((Math.random() * 1000) + 1)
// var uploadTask = wx.uploadFile({
// url: atter.host.replace("http:", "https:"),
// filePath: tempFilePaths[i],
// name: 'file',
// formData: {
// 'key': atter.dir + time + '.jpg',
// 'OSSAccessKeyId': atter.accessid,
// 'policy': atter.policy,
// 'Signature': atter.signature,
// 'success_action_status': '200',
// 'callback':atter.callback,
// },
// success: function(res) {
// successUp++;
// if (res.statusCode != 200) {
// // console.log({errCode: '599', msg:'其他错误'})
// return;
// }
// if (res.statusCode == 200){
// _this.percent = 100
// uni.showToast({ title: '上传成功', icon: 'none',duration: 3000 })
// console.log(atter.host + '/' + atter.dir + time + '.jpg')
// }
// },
// fail: function(err) {
// failUp++;
// wx.showToast({title: '上传失败!',icon: 'none',duration: 1200})
// },
// complete: function(err) {
// console.log('总共' + successUp + '张上传成功,' + failUp + '张上传失败!');
// }
// })
// uploadTask.onProgressUpdate((res) => {
// console.log('上传进度', res.progress + " " + new Date())
// console.log('已经上传的数据长度', res.totalBytesSent)
// console.log('预期需要上传的数据总长度', res.totalBytesExpectedToSend)
// })
// }
// })
// },
getQueryString(url, name) {
var reg = new RegExp('(^|&|/?)' + name + '=([^&|/?]*)(&|/?|$)', 'i')
var r = url.substr(1).match(reg)
......@@ -222,7 +128,6 @@
this.touchEndTime = e.timeStamp;
},
doubleTap(e) {
//console.log("doubleTap=");
// 控制点击事件在350ms内触发,加这层判断是为了防止长按时会触发点击事件
if (this.touchEndTime - this.touchStartTime < 350) {
// 当前点击的时间
......@@ -235,13 +140,9 @@
if (!this.$AppContext.checkLogin()) {
this.tologo('navigateTo')
} else {
//console.log("进来=");
uni.navigateTo({
url: '../index/machineDetail?machine_id=' + this.$Env.getmachineId()
});
//uni.navigateTo({
// url: '../index/index',
//})
}
}
}
......
<template>
<!-- 贴图 -->
<view class="content" style="width: 100%; height: 100%; position: relative;"
:style="{height: (windowHeight - classificationHeight) +'px'}">
:style="{height: (windowHeight - classificationHeight) +'px',background:backColorValue}">
<refresh @interrupt="interrupt" @pushToInterrupt="pushToInterrupt" @finished="finished" @scrolltolower="g"
:scrollHeight="(windowHeight - classificationHeight)" :scrollTop="scrollViewTop" @scroll="scroll">
<template slot="top">
......@@ -17,7 +17,6 @@
style="width: 139upx; height: 255upx; margin: auto; border-radius: 14px; overflow: hidden;"
:src="(item.image ? item.image:item.url) + '?x-oss-process=image/resize,lfit,w_112'"
mode="aspectFit"></image>
</view>
</view>
<view class="align-center"
......@@ -25,8 +24,7 @@
v-if="datalist.length == 0">
<span class="iconfont icon-wushuju"
style="font-size: 100upx; text-align: center; color: #B2B2B2;"></span>
<view style="color: #B2B2B2; text-align: center; line-height: 50upx;font-size: 24upx;">啊嘞,还是一片荒漠
</view>
<view style="color: #B2B2B2; text-align: center; line-height: 50upx;font-size: 24upx;">啊嘞,还是一片荒漠</view>
</view>
</view>
</template>
......@@ -73,7 +71,6 @@
material_series_id: "",
},
Material_categorydatalist: [], //作品、贴图列表
historyQueryPage: {
goods_id: "", //产品Id
s: 'Works.myList',
......@@ -90,6 +87,7 @@
scrollViewTop: 0, //滑动高度
e: 0, //弹窗类型
isWork: false, //是否作品
backColorValue:""
};
},
mounted() {
......@@ -99,6 +97,7 @@
* 组件的公有方法列表
*/
methods: {
//作品详情
Worksdetail(item) {
//console.log(item)
......@@ -163,6 +162,11 @@
},
open(item) {
if(item.val){
this.backColorValue = item.val
}else{
this.backColorValue = ""
}
if (this.e != item.e) {
this.datalist = [];
}
......@@ -179,7 +183,6 @@
} else {
loadData = true;
}
if (this.datalist == null || this.datalist.length == 0) {
loadData = true;
}
......@@ -207,7 +210,8 @@
is_hot: item.queryPage.is_hot, //热门
goods_id: "", //商品id
is_under: item.queryPage.is_under, //贴图是否为背景图
partner_id: item.queryPage.partner_id //代理
partner_id: item.queryPage.partner_id ,//代理
goods_feature_id:this.$base.goods_feature_id
}
if (item.e == 2) {
if (loadData) {
......
......@@ -12,7 +12,7 @@
src="../../static/img/icon_qiehuan.png"
mode="aspectFill" @click="bgtextcolor"></image>
<view style="width: 80upx; margin-top: 45upx;margin-left: 45upx;" @click="typefaceshow('share')">
<text style="font-size: 36upx; color: #FFFFFF;">字体</text>
<text style="font-size: 36upx; color: #FFFFFF;">字体</text>
</view>
</view>
</view>
......@@ -24,7 +24,7 @@
height: 98upx;">
<view style="width: 601upx; height: 57upx; background: rgb(255,255,255,0.1); margin: 21upx 41upx 21upx 21upx; border-radius: 10upx;">
<input :fixed="true" :auto-height="true" :show-confirm-bar="false" :cursor-spacing="73" :adjust-position="false"
type="text" maxlength="20" @input="textInput" :value="data.currentText" @focus="focusTextarea" @blur="blurTextarea"
type="text" maxlength="20" @input="textInput" v-model="data.currentText" @focus="focusTextarea" @blur="blurTextarea"
placeholder="请输入文字内容..." style="font-size: 34upx; font-weight: 400; height: 57upx; line-height: 57upx; padding: 0upx 0 0upx 20upx; color: #FFFFFF;" />
</view>
<view style="width: 1px; height: 28upx; background: #FFFFFF;"></view>
......@@ -43,15 +43,11 @@
:style="{'color': data.itemList[data.cidx].font_dict_id == item.id ? '#F56364 !important' : '#ffffff'}">
色彩公园
</text>
<!-- <text v-if="item.remark != ''">
{{item.long ? '' : '(下载该字体)'}}
</text> -->
<text v-if="item.remark != ''">
{{item.long == true ? '' : '(点击加载)'}}
</text>
<!-- <text v-if="item.remark != ''" style="color: #864BC3;">
{{item.textlong == true ? '(加载成功)' : ''}}
</text> -->
<text v-if="item.remark != ''" style="color: #F56364;">
{{item.textlong == false ? '(下载失败,点击重新下载)' : ''}}
</text>
......@@ -61,23 +57,7 @@
</scroll-view>
</view>
<view v-if="show && text != 'typeface'" style="display: flex; height: 90upx; padding: 38upx 0 41upx; align-items: center;">
<!-- 背景 -->
<!-- <view style="width: calc(100% / 7);" @click="bgtextcolor">
<image style="width: 69upx; height: 69upx; display: block;margin: auto;" :src="bg_text_color ? '../../static/icon/icon_qiehuan_one.png' : '../../static/icon/icon_qiehuan.png'"
mode="aspectFill"></image>
</view> -->
<!-- 颜色 开始-->
<!-- <scroll-view style="box-sizing: border-box; white-space: nowrap; margin: 10upx 0; " scroll-x scroll-with-animation >
<view style="text-align: center; display: inline-block; padding-left: 20upx;" v-for="(item,index) in colorList" :key="index" @click.stop="workcolor(item.color)">
<view v-if="data.itemList[data.cidx]">
<view v-if="data.itemList[data.cidx].font_color == item.color && !bg_text_color" style="width: 60upx; height: 60upx; background: #000000; border: 4upx solid #EF6262; border-radius: 50%;" :style="{background:item.color}"></view>
<view v-else-if="data.itemList[data.cidx].under_color == item.color && bg_text_color" style="width: 60upx; height: 60upx; background: #000000; border: 4upx solid #EF6262; border-radius: 50%;" :style="{background:item.color}" ></view>
<view v-else style="width: 68upx; height: 68upx; border-radius: 50%;" :style="{background:item.color}" ></view>
</view>
<view v-else style="width: 68upx; height: 68upx; border-radius: 50%;" :style="{background:item.color}"></view>
</view>
</scroll-view> -->
<!-- 颜色 结束-->
<!-- 颜色 开始-->
<scroll-view style="box-sizing: border-box; white-space: nowrap;
margin-left: 35upx; margin-right: 35upx;margin-bottom: 30upx; margin-top: 40upx; width: calc(100% - 70upx);" scroll-x
......@@ -101,45 +81,6 @@
</scroll-view>
<!-- 颜色 结束-->
<!-- 颜色 -->
<!-- <view style="width: calc(100% / 7);" @click.stop="workcolor('#000000')">
<view v-if="data.itemList[data.cidx].font_color == '#000000' && !bg_text_color" style="width: 60upx; height: 60upx; background: #000000; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else-if="data.itemList[data.cidx].under_color == '#000000' && bg_text_color" style="width: 60upx; height: 60upx; background: #000000; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else style="width: 68upx; height: 68upx; background: #000000; border-radius: 50%;"></view>
</view>
<view style="width: calc(100% / 7);" @click.stop="workcolor('#FFFFFF')">
<view v-if="data.itemList[data.cidx].font_color == '#FFFFFF' && !bg_text_color" style="width: 60upx; height: 60upx; background: #FFFFFF; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else-if="data.itemList[data.cidx].under_color == '#FFFFFF' && bg_text_color" style="width: 60upx; height: 60upx; background: #FFFFFF; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else style="width: 68upx; height: 68upx; background: #FFFFFF; border-radius: 50%;"></view>
</view>
<view style="width: calc(100% / 7);" @click.stop="workcolor('#E60012')">
<view v-if="data.itemList[data.cidx].font_color == '#E60012' && !bg_text_color" style="width: 60upx; height: 60upx; background: #E60012; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else-if="data.itemList[data.cidx].under_color == '#E60012' && bg_text_color" style="width: 60upx; height: 60upx; background: #E60012; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else style="width: 68upx; height: 68upx; background: #E60012; border-radius: 50%;"></view>
</view>
<view style="width: calc(100% / 7);" @click.stop="workcolor('#060CDE')">
<view v-if="data.itemList[data.cidx].font_color == '#060CDE' && !bg_text_color" style="width: 60upx; height: 60upx; background: #060CDE; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else-if="data.itemList[data.cidx].under_color == '#060CDE' && bg_text_color" style="width: 60upx; height: 60upx; background: #060CDE; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else style="width: 68upx; height: 68upx; background: #060CDE; border-radius: 50%;"></view>
</view>
<view style="width: calc(100% / 7);" @click.stop="workcolor('#E65C00')">
<view v-if="data.itemList[data.cidx].font_color == '#E65C00' && !bg_text_color" style="width: 60upx; height: 60upx; background: #E65C00; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else-if="data.itemList[data.cidx].under_color == '#E65C00' && bg_text_color" style="width: 60upx; height: 60upx; background: #E65C00; border: 4upx solid #EF6262; border-radius: 50%;"></view>
<view v-else style="width: 68upx; height: 68upx; background: #E65C00; border-radius: 50%;"></view>
</view> -->
<!-- 加粗 -->
<!-- <view style="width: calc(100% / 7);" @click.stop='workweight'>
<view v-if="data.itemList[data.cidx].font_style != 'bold'" style="width: 68upx; height: 68upx; text-align: center; background: #282A32; border-radius: 5px;">
<text style="font-size: 34upx; font-weight: 800; color: #666666; line-height: 68upx;">B</text>
</view>
<view v-else style="width: 68upx; height: 68upx; text-align: center; background: #F56364; border-radius: 5px;">
<text style="font-size: 34upx; font-weight: 800; color: #fff; line-height: 68upx;">B</text>
</view>
</view> -->
<!-- 字体 -->
<!-- <view style="width: calc(100% / 7); text-align: center;" @click="typefaceshow('share')">
<text style="font-size: 24upx; color: #FFFFFF;">字体</text>
</view> -->
</view>
<view v-if="!show" style="position: absolute; bottom: 100upx; width: 100%; background: #292933;">
<!-- 修改 -->
......@@ -148,7 +89,7 @@
height: 99upx;">
<view style="width: 710upx; height: 57upx; background: rgb(255,255,255,0.1); margin: 20upx 40upx 20upx 20upx; border-radius: 10upx;">
<input :fixed="true" :auto-height="true" :show-confirm-bar="false" :cursor-spacing="73" :adjust-position="false"
type="text" maxlength="32" @input="textInput" :value="data.currentText" @focus="focusTextarea" @blur="blurTextarea"
type="text" maxlength="32" @input="textInput" v-model="data.currentText" @focus="focusTextarea" @blur="blurTextarea"
placeholder="请输入文字内容..." style="font-size: 34upx; font-weight: 400; height: 57upx; line-height: 57upx; padding: 0upx 0 0upx 20upx; color: #FFFFFF;" />
</view>
</view>
......@@ -752,6 +693,17 @@
* 组件的公有方法列表
*/
methods: {
//过滤字符串
filterTextInput(textStr) {
let content = textStr.replace(/[^\a-\z\A-\Z0-9\u4E00-\u9FA5\.\,\?\<\>\。\,\-\—\=\;\@\!\!\+\$\%\*\(\)\#\&\*]/g, '');
let that = this;
setTimeout(function() {
that.data.currentText = content;
that.$emit('textInput', content)
}, 0);
},
typefaceshow(e){
this.$emit('typefaceshow', e)
},
......@@ -779,16 +731,6 @@
}else{
this.$emit('typefaceClick', e)
}
// if(e.textlong == true){
// this.$emit('typefaceClick', e)
// }else{
// if(e.remark != ''){
// this.loadFont(e)
// }else{
// this.$emit('typefaceClick', e)
// }
// }
},
loadFont(textlist) {
let that = this;
......@@ -853,7 +795,8 @@
this.inputBottom = 0;
},
textInput(e) {
this.$emit('textInput', e)
this.filterTextInput(e.detail.value)
//this.$emit('textInput', e)
},
cancel(e) {
this.$emit('cancel', e)
......
......@@ -96,7 +96,6 @@
hollowCircleMode: false,
lastHollowRect: {},
lastHollowCircle: {},
MobilePhoneHeight: 0,
MobilePhoneWidth: 0,
pixelRate: 1,
......@@ -204,7 +203,6 @@
})
},
colorPickTapHandler(obj) {
// console.log('我点击的颜色:' + JSON.stringify(obj));
this.colorPanelShow = false;
this.toolArr.forEach(item => {
item.select = false;
......@@ -221,7 +219,6 @@
this.drawContext.strokeStyle = obj.color;
},
penWidthChangeHandler(width) {
// console.log('画笔宽度:' + width);
this.lineWidth = width;
this.drawContext.setLineWidth(width);
this.drawContext.setLineCap('round') // 让线条圆润
......
static/icon/designer-f.png

1.72 KB | W: | H:

static/icon/designer-f.png

656 Bytes | W: | H:

static/icon/designer-f.png
static/icon/designer-f.png
static/icon/designer-f.png
static/icon/designer-f.png
  • 2-up
  • Swipe
  • Onion skin
static/icon/designer-o.png

1.57 KB | W: | H:

static/icon/designer-o.png

481 Bytes | W: | H:

static/icon/designer-o.png
static/icon/designer-o.png
static/icon/designer-o.png
static/icon/designer-o.png
  • 2-up
  • Swipe
  • Onion skin
static/icon/diy_icon_editor_default.png

1.43 KB | W: | H:

static/icon/diy_icon_editor_default.png

901 Bytes | W: | H:

static/icon/diy_icon_editor_default.png
static/icon/diy_icon_editor_default.png
static/icon/diy_icon_editor_default.png
static/icon/diy_icon_editor_default.png
  • 2-up
  • Swipe
  • Onion skin
static/icon/diy_icon_editor_pressed.png

1.41 KB | W: | H:

static/icon/diy_icon_editor_pressed.png

882 Bytes | W: | H:

static/icon/diy_icon_editor_pressed.png
static/icon/diy_icon_editor_pressed.png
static/icon/diy_icon_editor_pressed.png
static/icon/diy_icon_editor_pressed.png
  • 2-up
  • Swipe
  • Onion skin
static/icon/diy_icon_on_default.png

948 Bytes | W: | H:

static/icon/diy_icon_on_default.png

533 Bytes | W: | H:

static/icon/diy_icon_on_default.png
static/icon/diy_icon_on_default.png
static/icon/diy_icon_on_default.png
static/icon/diy_icon_on_default.png
  • 2-up
  • Swipe
  • Onion skin
static/icon/diy_icon_remove_normal.png

2.22 KB | W: | H:

static/icon/diy_icon_remove_normal.png

1.11 KB | W: | H:

static/icon/diy_icon_remove_normal.png
static/icon/diy_icon_remove_normal.png
static/icon/diy_icon_remove_normal.png
static/icon/diy_icon_remove_normal.png
  • 2-up
  • Swipe
  • Onion skin
static/icon/diy_icon_up_default.png

943 Bytes | W: | H:

static/icon/diy_icon_up_default.png

553 Bytes | W: | H:

static/icon/diy_icon_up_default.png
static/icon/diy_icon_up_default.png
static/icon/diy_icon_up_default.png
static/icon/diy_icon_up_default.png
  • 2-up
  • Swipe
  • Onion skin
static/icon/home-f.png

1.21 KB | W: | H:

static/icon/home-f.png

294 Bytes | W: | H:

static/icon/home-f.png
static/icon/home-f.png
static/icon/home-f.png
static/icon/home-f.png
  • 2-up
  • Swipe
  • Onion skin
static/icon/home-o.png

1.19 KB | W: | H:

static/icon/home-o.png

232 Bytes | W: | H:

static/icon/home-o.png
static/icon/home-o.png
static/icon/home-o.png
static/icon/home-o.png
  • 2-up
  • Swipe
  • Onion skin
static/icon/icon_close.png

1.55 KB | W: | H:

static/icon/icon_close.png

725 Bytes | W: | H:

static/icon/icon_close.png
static/icon/icon_close.png
static/icon/icon_close.png
static/icon/icon_close.png
  • 2-up
  • Swipe
  • Onion skin
static/image/icon_confirm.png

1014 Bytes | W: | H:

static/image/icon_confirm.png

701 Bytes | W: | H:

static/image/icon_confirm.png
static/image/icon_confirm.png
static/image/icon_confirm.png
static/image/icon_confirm.png
  • 2-up
  • Swipe
  • Onion skin
static/image/icon_hot_default.png

2.04 KB | W: | H:

static/image/icon_hot_default.png

1.14 KB | W: | H:

static/image/icon_hot_default.png
static/image/icon_hot_default.png
static/image/icon_hot_default.png
static/image/icon_hot_default.png
  • 2-up
  • Swipe
  • Onion skin
static/image/icon_hot_pressed.png

2.15 KB | W: | H:

static/image/icon_hot_pressed.png

1.27 KB | W: | H:

static/image/icon_hot_pressed.png
static/image/icon_hot_pressed.png
static/image/icon_hot_pressed.png
static/image/icon_hot_pressed.png
  • 2-up
  • Swipe
  • Onion skin
static/image/icon_new_default.png

2.09 KB | W: | H:

static/image/icon_new_default.png

1.14 KB | W: | H:

static/image/icon_new_default.png
static/image/icon_new_default.png
static/image/icon_new_default.png
static/image/icon_new_default.png
  • 2-up
  • Swipe
  • Onion skin
static/image/icon_new_pressed.png

2.26 KB | W: | H:

static/image/icon_new_pressed.png

1.23 KB | W: | H:

static/image/icon_new_pressed.png
static/image/icon_new_pressed.png
static/image/icon_new_pressed.png
static/image/icon_new_pressed.png
  • 2-up
  • Swipe
  • Onion skin
static/image/remind_picture.png

40.9 KB | W: | H:

static/image/remind_picture.png

10.8 KB | W: | H:

static/image/remind_picture.png
static/image/remind_picture.png
static/image/remind_picture.png
static/image/remind_picture.png
  • 2-up
  • Swipe
  • Onion skin
......@@ -13,12 +13,10 @@ const baseApi = {
release: "https://tprint.colorpark.cn",
};
const baseURL = baseApi[accountInfo.miniProgram.envVersion]
//console.log(accountInfo.miniProgram.envVersion)
//console.log(baseURL)
const Env = {
getDevBaseURL: () => baseURL,
getBaseURL: () => baseURL,
getmachineId: () => '100055', //线上100086 //测试 422001' //100086 //100055
getmachineId: () => '100055', //线上111001
getappcode: () => 'lite',
getmalltext: () => "色彩公园Lite",
getAppID: () => "wx1c777ee874c39b0b",
......@@ -27,7 +25,5 @@ const Env = {
getappId: () => "wx55b5b6d95c648041",
//getenvVersion: () => "trial",
getenvVersion: () => "release",
}
export default Env
\ No newline at end of file
......@@ -12,5 +12,6 @@ export default {
machine_id:0,//用户进入设备id
coupon_flag_desc:'',//提示,如:当前贴图为“森之谷”IP图,需提前领取代金券方可使用,如未领券请前往XXX领券。
lockInventory:null,//锁库存储存信息
goods_feature_id:null, //属性
}
// this.$base.promoter_id
\ No newline at end of file
......@@ -10,14 +10,14 @@ request.interceptors.request.use((config, promise) => {
//超时设置
if (config._timeout) config.timeout = 60000;
//从环境变量中取 BASE_UR
console.log(process)
//console.log(process)
if (process.env.NODE_ENV === 'development') config.baseURL = Env.getDevBaseURL()
else config.baseURL = Env.getBaseURL()
//JSON格式化,未指定时,默认true
config.parseJson = $n._isNotNull(config.parseJson) ? config.parseJson : true
// 如指定_token == true,则在headers中跟上相关token信息
if (config._token) config.headers['token'] = store.getters.appUser.token;
console.warn('####### API Request: ', config)
//console.warn('####### API Request: ', config)
return config
})
......@@ -41,7 +41,7 @@ request.interceptors.response.use(
},
(error, promise) => {
let msg = $n._caseValue(error.code, 0, '网络连接异常', 1, '网络连接超时', 401, '请求服务未授权', error.msg)
console.error('####### API Response error: ', error)
//console.error('####### API Response error: ', error)
if (error.status == 401 ) {
uni.showModal({
title: '',
......@@ -60,8 +60,6 @@ request.interceptors.response.use(
})
} else return promise.reject(msg)
},
)
export default request
\ No newline at end of file
import CryptoJS from 'crypto-js';
/**
* ========================================================================================================================
* 以RecognizeBankCard为例。
* 这里只是为了小程序端演示流程,所以将代码写在了小程序端
* 真正上线不建议将ACCESS_KEY_ID和ACCESS_KEY_SECRET写在小程序端,会有泄漏风险,建议将请求API接口代码写到您的服务端
* 请求银行卡识别:https://help.aliyun.com/document_detail/151893.html
* ========================================================================================================================
*/
// 参数说明:
// miniProgramType:小程序类型,比如:微信小程序传参数:wx,支付宝传参数:my,钉钉传参数:dd,注意不要传字符串;
// callback:结果的回调
// type 1: 人物动漫化 2:人物素描化
function callRecognizeBankCard(imageURL,miniProgramType,type,callback) {
const accessKeyId = "LTAI5tDPiEBZgfqNcWBqaFEc";
//AccessKeySecret
const accessKeySecret = "amI84BLFbHz6dhOVbuArrERmeemmnx";
//这里endpoint为API访问域名,与类目相关,具体类目的API访问域名请参考:https://help.aliyun.com/document_detail/143103.html
const endpoint = "facebody.cn-shanghai.aliyuncs.com";
//API Action,能力名称,请参考具体算法文档详情页中的Action参数,这里以银行卡识别为例:https://help.aliyun.com/document_detail/151893.html
let Action = "GenerateHumanAnimeStyle";
//API_HTTP_METHOD推荐使用POST
const API_HTTP_METHOD = "POST";
//API_VERSION为API版本,与类目相关,具体类目的API版本请参考:https://help.aliyun.com/document_detail/464194.html
const API_VERSION = "2019-12-30";
const request_ = {};
if(type == 2 ){
Action = "GenerateHumanSketchStyle";
request_["ReturnType"] = "full";
}else{
request_["AlgoType"] = "handdrawn";
}
//系统参数
request_["SignatureMethod"] = "HMAC-SHA1";
request_["SignatureNonce"] = signNRandom();
request_["AccessKeyId"] = accessKeyId;
request_["SignatureVersion"] = "1.0";
request_["Timestamp"] = getTimestamp();
request_["Format"] = "JSON";
request_["RegionId"] = "cn-shanghai";
request_["Version"] = API_VERSION;
request_["ImageURL"] = imageURL;
request_["Action"] = Action;
callApiRequest(miniProgramType, request_, API_HTTP_METHOD, endpoint, accessKeySecret, callback);
};
//请求数据
function callApiRequest(miniProgramType, request_, API_HTTP_METHOD, endpoint, accessKeySecret, callback) {
const url = generateUrl(request_, API_HTTP_METHOD, endpoint, accessKeySecret);
miniProgramType.request({
url: url,
method: 'POST',
header: {
"ContentType": "application/json"
},
success: (result) => {
// 获取结果
return typeof callback == "function" && callback(result.data)
},
fail: (error) => {
// 获取报错信息
return typeof callback == "function" && callback(error.data)
}
})
};
//随机数字
function signNRandom() {
const Rand = Math.random()
const mineId = Math.round(Rand * 100000000000000)
return mineId;
};
function getTimestamp() {
let date = new Date();
let YYYY = pad2(date.getUTCFullYear());
let MM = pad2(date.getUTCMonth() + 1);
let DD = pad2(date.getUTCDate());
let HH = pad2(date.getUTCHours());
let mm = pad2(date.getUTCMinutes());
let ss = pad2(date.getUTCSeconds());
return `${YYYY}-${MM}-${DD}T${HH}:${mm}:${ss}Z`;
};
function pad2(num) {
if (num < 10) {
return '0' + num;
}
return '' + num;
};
function ksort(params) {
let keys = Object.keys(params).sort();
let newParams = {};
keys.forEach((key) => {
newParams[key] = params[key];
});
return newParams;
};
function createHmac(stringToSign, key) {
const CrypStringToSign = CryptoJS.HmacSHA1(CryptoJS.enc.Utf8.parse(stringToSign), key);
const base64 = CryptoJS.enc.Base64.stringify(CrypStringToSign);
return base64;
};
function encode(str) {
var result = encodeURIComponent(str);
return result.replace(/!/g, '%21')
.replace(/'/g, '%27')
.replace(/\(/g, '%28')
.replace(/\)/g, '%29')
.replace(/\*/g, '%2A');
};
function sha1(stringToSign, key) {
return createHmac(stringToSign, key);
};
function getSignature(signedParams, method, secret) {
var stringToSign = `${method}&${encode('/')}&${encode(signedParams)}`;
const key = secret + "&";
return sha1(stringToSign, key);
};
//参数拼接
function objToParam(param) {
if (Object.prototype.toString.call(param) !== '[object Object]') {
return '';
}
let queryParam = '';
for (let key in param) {
if (param.hasOwnProperty(key)) {
let value = param[key];
queryParam += toQueryPair(key, value);
}
}
return queryParam;
};
function toQueryPair(key, value) {
if (typeof value == 'undefined') {
return `&${key}=`;
}
return `&${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
};
function generateUrl(request, httpMethod, endpoint, accessKeySecret) {
//参数中key排序
const sortParams = ksort(request);
//拼成参数
const sortQueryStringTmp = objToParam(sortParams);
const sortedQueryString = sortQueryStringTmp.substring(1);// 去除第一个多余的&符号
//构造待签名的字符串
const Signture = getSignature(sortedQueryString, httpMethod, accessKeySecret)
//签名最后也要做特殊URL编码
request["Signature"] = encodeURIComponent(Signture);
//最终生成出合法请求的URL
const finalUrl = "https://" + endpoint + "/?Signature=" + encodeURIComponent(Signture) + sortQueryStringTmp;
return finalUrl;
};
//导出方法
module.exports = {
callRecognizeBankCard: callRecognizeBankCard,
signNRandom:signNRandom,
getTimestamp:getTimestamp,
generateUrl:generateUrl,
createHmac:createHmac
}
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