新增分享,长按操作,修改若干 bug
This commit is contained in:
parent
0eb66be201
commit
328129d94e
@ -66,6 +66,9 @@ const userAPI = {
|
||||
getDefaultPersonImage(){
|
||||
return request.get('/api/v1/person-images/default')
|
||||
},
|
||||
tryOnStatus:{
|
||||
trying:'生成中',error:'失败',success:'已生成'
|
||||
},
|
||||
/**
|
||||
*
|
||||
* @param {Object} data
|
||||
@ -77,6 +80,9 @@ const userAPI = {
|
||||
tryon(data){
|
||||
return request.post('/api/v1/tryon',data)
|
||||
},
|
||||
tryonDetail(history_id){
|
||||
return request.get(`/api/v1/tryon/history/${history_id}`)
|
||||
},
|
||||
checkTryon(history_id){
|
||||
return request.get(`/api/v1/tryon/history/${history_id}/check`)
|
||||
},
|
||||
@ -85,6 +91,9 @@ const userAPI = {
|
||||
},
|
||||
deleteTryon(history_id){
|
||||
return request.delete(`/api/v1/tryon/history/${history_id}`)
|
||||
},
|
||||
getTryonComment(history_id){
|
||||
return request.get('/api/v1/tryon/comment',{history_id})
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
4
app.js
4
app.js
@ -1,6 +1,8 @@
|
||||
App({
|
||||
onLaunch() {
|
||||
console.log(111);
|
||||
},
|
||||
onShow(options){
|
||||
console.log(options);
|
||||
},
|
||||
globalData: {
|
||||
userInfo: null
|
||||
|
||||
6
app.json
6
app.json
@ -24,6 +24,12 @@
|
||||
"text": "试衣间",
|
||||
"iconPath": "/assets/tabbar/tab2.png",
|
||||
"selectedIconPath": "/assets/tabbar/tab2-active.png"
|
||||
},
|
||||
{
|
||||
"pagePath": "pages/my/index/index",
|
||||
"text": "我的",
|
||||
"iconPath": "/assets/tabbar/tab3.png",
|
||||
"selectedIconPath": "/assets/tabbar/tab3-active.png"
|
||||
}
|
||||
]
|
||||
},
|
||||
|
||||
107
app.wxss
107
app.wxss
@ -2,11 +2,12 @@
|
||||
page{
|
||||
--main-color:#FF2727;
|
||||
--main-bgclolor:#ffffff;
|
||||
--main-font-color:#333;
|
||||
--safe-bottom:constant(safe-area-inset-bottom);
|
||||
--safe-bottom:env(safe-area-inset-bottom);
|
||||
background-color: var(--main-bgclolor);
|
||||
font-size: 30rpx;
|
||||
color: #333333;
|
||||
color: var(--main-font-color);
|
||||
line-height: 1;
|
||||
height: 100vw;
|
||||
overflow: hidden;
|
||||
@ -46,4 +47,108 @@ button.icon-button{
|
||||
.custom-scroll-view .main{
|
||||
overflow: hidden;
|
||||
flex:1;
|
||||
}
|
||||
|
||||
|
||||
radio{
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
position: relative;
|
||||
}
|
||||
radio .wx-radio-input{
|
||||
border-radius: 50%;
|
||||
border-color:var(--main-color);
|
||||
box-sizing: border-box;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
position: absolute;
|
||||
top: 0;left:0;
|
||||
}
|
||||
radio .wx-radio-input.wx-radio-input-checked{
|
||||
background-color:transparent;
|
||||
border-color: var(--main-color);
|
||||
}
|
||||
radio .wx-radio-input.wx-radio-input-checked::before{
|
||||
content: '';
|
||||
position: absolute;
|
||||
width: 14px;
|
||||
height:14px;
|
||||
left:2px;top:2px;
|
||||
border-radius: 50%;
|
||||
background: var(--main-color);
|
||||
transform: none;
|
||||
-webkit-transform:none
|
||||
}
|
||||
|
||||
|
||||
.cells{
|
||||
margin:20rpx;
|
||||
border-radius: 24rpx;
|
||||
background-color: #fff;
|
||||
overflow: hidden;
|
||||
}
|
||||
.cells .cell{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding:0 40rpx;
|
||||
font-size: 30rpx;
|
||||
position: relative;
|
||||
}
|
||||
.cells .cell.cell-active{
|
||||
background-color:rgba(0,0,0,.1);
|
||||
}
|
||||
.cells .cell::after{
|
||||
content: '';
|
||||
border-bottom: 1rpx solid rgba(153, 153, 153, 0.2);
|
||||
position: absolute;
|
||||
bottom:0;
|
||||
left:40rpx;
|
||||
right:40rpx;
|
||||
}
|
||||
.cells .cell:last-child::after{
|
||||
border:0;
|
||||
}
|
||||
.cells .cell-hd{
|
||||
margin-right:20rpx;
|
||||
}
|
||||
.cells .cell-hd .icon{
|
||||
width:40rpx;height:40rpx;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.cells .cell-bd{
|
||||
flex:1;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
position:relative;
|
||||
min-height: 116rpx;
|
||||
}
|
||||
.cells .cell-bd .error{
|
||||
color:red;
|
||||
position: absolute;
|
||||
left:0;bottom:10rpx;
|
||||
font-size: 24rpx;
|
||||
}
|
||||
.cells .cell-bd input{
|
||||
height:100rpx;
|
||||
width: 100%;
|
||||
}
|
||||
.cells .cell-ft{
|
||||
position: relative;
|
||||
color:#999;
|
||||
}
|
||||
.cells.cells-access .cell-ft{
|
||||
padding-right: 40rpx;
|
||||
}
|
||||
.cells.cells-access .cell-ft::after{
|
||||
content:" ";
|
||||
width:24rpx;height:48rpx;
|
||||
-webkit-mask-position:0 0;
|
||||
mask-position:0 0;
|
||||
-webkit-mask-repeat:no-repeat;
|
||||
mask-repeat:no-repeat;
|
||||
-webkit-mask-size:100%;
|
||||
mask-size:100%;
|
||||
background-color:currentColor;
|
||||
color:var(--weui-FG-2);
|
||||
-webkit-mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);mask-image:url(data:image/svg+xml,%3Csvg%20width%3D%2212%22%20height%3D%2224%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2.454%206.58l1.06-1.06%205.78%205.779a.996.996%200%20010%201.413l-5.78%205.779-1.06-1.061%205.425-5.425-5.425-5.424z%22%20fill%3D%22%23B2B2B2%22%20fill-rule%3D%22evenodd%22%2F%3E%3C%2Fsvg%3E);position:absolute;top:50%;right:0;margin-top:-24rpx
|
||||
}
|
||||
@ -47,6 +47,10 @@
|
||||
mask-image: var(--icon-delete);
|
||||
-webkit-mask-image: var(--icon-delete);
|
||||
}
|
||||
.icon.history{
|
||||
mask-image: var(--icon-history);
|
||||
-webkit-mask-image: var(--icon-history);
|
||||
}
|
||||
.icon.warn{
|
||||
position: relative;
|
||||
background-color: #fff;
|
||||
@ -76,5 +80,6 @@ page{
|
||||
--icon-plus:url(data:image/svg+xml,%3Csvg%20t%3D%221744381143353%22%20class%3D%22icon%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20p-id%3D%2244078%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Cpath%20d%3D%22M512%201024a58.336%2058.336%200%200%201-58.368-58.368V58.368a58.336%2058.336%200%201%201%20116.736%200v907.264c0%2031.744-25.6%2058.368-58.368%2058.368z%20m453.632-453.632H58.368a58.336%2058.336%200%201%201%200-116.736h907.264a58.336%2058.336%200%201%201%200%20116.736z%22%20p-id%3D%2244079%22%3E%3C/path%3E%3C/svg%3E);
|
||||
--icon-loading:url(data:image/svg+xml,%3C%3Fxml%20version%3D%271.0%27%20encoding%3D%27UTF-8%27%3F%3E%3Csvg%20width%3D%2780px%27%20height%3D%2780px%27%20viewBox%3D%270%200%2080%2080%27%20version%3D%271.1%27%20xmlns%3D%27http%3A//www.w3.org/2000/svg%27%20xmlns%3Axlink%3D%27http%3A//www.w3.org/1999/xlink%27%3E%3Ctitle%3Eloading%3C/title%3E%3Cdefs%3E%3ClinearGradient%20x1%3D%2794.0869141%25%27%20y1%3D%270%25%27%20x2%3D%2794.0869141%25%27%20y2%3D%2790.559082%25%27%20id%3D%27linearGradient-1%27%3E%3Cstop%20stop-color%3D%27%23606060%27%20stop-opacity%3D%270%27%20offset%3D%270%25%27%3E%3C/stop%3E%3Cstop%20stop-color%3D%27%23606060%27%20stop-opacity%3D%270.3%27%20offset%3D%27100%25%27%3E%3C/stop%3E%3C/linearGradient%3E%3ClinearGradient%20x1%3D%27100%25%27%20y1%3D%278.67370605%25%27%20x2%3D%27100%25%27%20y2%3D%2790.6286621%25%27%20id%3D%27linearGradient-2%27%3E%3Cstop%20stop-color%3D%27%23606060%27%20offset%3D%270%25%27%3E%3C/stop%3E%3Cstop%20stop-color%3D%27%23606060%27%20stop-opacity%3D%270.3%27%20offset%3D%27100%25%27%3E%3C/stop%3E%3C/linearGradient%3E%3C/defs%3E%3Cg%20stroke%3D%27none%27%20stroke-width%3D%271%27%20fill%3D%27none%27%20fill-rule%3D%27evenodd%27%20opacity%3D%270.9%27%3E%3Cg%3E%3Cpath%20d%3D%27M40%2C0%20C62.09139%2C0%2080%2C17.90861%2080%2C40%20C80%2C62.09139%2062.09139%2C80%2040%2C80%20L40%2C73%20C58.2253967%2C73%2073%2C58.2253967%2073%2C40%20C73%2C21.7746033%2058.2253967%2C7%2040%2C7%20L40%2C0%20Z%27%20fill%3D%27url%28%23linearGradient-1%29%27%3E%3C/path%3E%3Cpath%20d%3D%27M40%2C0%20L40%2C7%20C21.7746033%2C7%207%2C21.7746033%207%2C40%20C7%2C58.2253967%2021.7746033%2C73%2040%2C73%20L40%2C80%20C17.90861%2C80%200%2C62.09139%200%2C40%20C0%2C17.90861%2017.90861%2C0%2040%2C0%20Z%27%20fill%3D%27url%28%23linearGradient-2%29%27%3E%3C/path%3E%3Ccircle%20id%3D%27Oval%27%20fill%3D%27%23606060%27%20cx%3D%2740.5%27%20cy%3D%273.5%27%20r%3D%273.5%27%3E%3C/circle%3E%3C/g%3E%3CanimateTransform%20attributeName%3D%27transform%27%20begin%3D%270s%27%20dur%3D%271s%27%20type%3D%27rotate%27%20values%3D%270%2040%2040%3B360%2040%2040%27%20repeatCount%3D%27indefinite%27/%3E%3C/g%3E%3C/svg%3E);
|
||||
--icon-warn:url(data:image/svg+xml,%3Csvg%20t%3D%221744472102058%22%20class%3D%22icon%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20p-id%3D%2255997%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Cpath%20d%3D%22M512%200C229.205333%200%200%20229.205333%200%20512s229.205333%20512%20512%20512%20512-229.205333%20512-512S794.794667%200%20512%200z%20m0%20796.458667A56.917333%2056.917333%200%201%201%20511.957333%20682.666667%2056.917333%2056.917333%200%200%201%20512%20796.458667z%20m54.186667-227.797334h0.128a60.501333%2060.501333%200%200%201-53.802667%2055.893334c2.048%200.256%203.882667%201.152%205.973333%201.152h-11.818666c2.048%200%203.84-0.981333%205.845333-1.109334a59.093333%2059.093333%200%200%201-53.162667-55.893333l-13.056-284.16a54.314667%2054.314667%200%200%201%2054.613334-57.045333h26.282666a52.992%2052.992%200%200%201%2054.186667%2057.002666l-15.146667%20284.16z%22%20fill%3D%22%23B94343%22%20p-id%3D%2255998%22%3E%3C/path%3E%3C/svg%3E);
|
||||
--icon-delete:url(data:image/svg+xml,%3Csvg%20t%3D%221744473381401%22%20class%3D%22icon%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20p-id%3D%2258654%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Cpath%20d%3D%22M512%200C228.864%200%200%20228.864%200%20512%200%20795.136%20228.864%201024%20512%201024%20795.136%201024%201024%20795.136%201024%20512%201024%20228.864%20795.136%200%20512%200ZM768%20695.808%20695.808%20768%20512%20584.192%20328.192%20768%20256%20695.808%20439.808%20512%20256%20328.192%20328.192%20256%20512%20439.808%20695.808%20256%20768%20328.192%20584.192%20512%20768%20695.808Z%22%20fill%3D%22%23000000%22%20p-id%3D%2258655%22%20data-spm-anchor-id%3D%22a313x.search_index.0.i52.389b3a81KbR0ru%22%3E%3C/path%3E%3C/svg%3E)
|
||||
--icon-delete:url(data:image/svg+xml,%3Csvg%20t%3D%221744473381401%22%20class%3D%22icon%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20p-id%3D%2258654%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Cpath%20d%3D%22M512%200C228.864%200%200%20228.864%200%20512%200%20795.136%20228.864%201024%20512%201024%20795.136%201024%201024%20795.136%201024%20512%201024%20228.864%20795.136%200%20512%200ZM768%20695.808%20695.808%20768%20512%20584.192%20328.192%20768%20256%20695.808%20439.808%20512%20256%20328.192%20328.192%20256%20512%20439.808%20695.808%20256%20768%20328.192%20584.192%20512%20768%20695.808Z%22%20fill%3D%22%23000000%22%20p-id%3D%2258655%22%20data-spm-anchor-id%3D%22a313x.search_index.0.i52.389b3a81KbR0ru%22%3E%3C/path%3E%3C/svg%3E);
|
||||
--icon-history:url(data:image/svg+xml,%3Csvg%20t%3D%221744605585155%22%20class%3D%22icon%22%20viewBox%3D%220%200%201024%201024%22%20version%3D%221.1%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%20p-id%3D%2259650%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Cpath%20d%3D%22M512.00768%2015.15008a496.19456%20496.19456%200%200%201%20351.38944%20145.63328l1.92896%202.176a496.768%20496.768%200%200%201-1.92896%20700.52864l-2.15424%201.60256a496.77952%20496.77952%200%200%201-700.65024-1.60256%20496.78976%20496.78976%200%200%201%200-702.43456v-0.2752h0.2752A494.51904%20494.51904%200%200%201%20512.00768%2015.15008z%20m217.07008%20458.60224H550.27712V169.71904a38.40768%2038.40768%200%201%200-76.81536%200v342.25664a38.85824%2038.85824%200%200%200%2038.54592%2038.528h217.07008c20.88832%200%2037.99424-17.34656%2037.99424-38.528a38.15936%2038.15936%200%200%200-37.99424-38.22336z%20m80.04608-259.0016a419.48288%20419.48288%200%200%200-297.11616-123.136c-116.43776%200-221.42848%2046.63296-297.69216%20123.136a421.504%20421.504%200%200%200%200%20594.47424%20420.77568%20420.77568%200%200%200%20593.20448%201.62688l1.60384-1.62688c76.0128-75.92064%20123.7504-181.15328%20123.7504-297.24928a419.904%20419.904%200%200%200-121.57184-295.59808l-2.176-1.62688z%22%20fill%3D%22%233B3F51%22%20p-id%3D%2259651%22%3E%3C/path%3E%3C/svg%3E)
|
||||
}
|
||||
6
node_modules/.package-lock.json
generated
vendored
6
node_modules/.package-lock.json
generated
vendored
@ -16,6 +16,12 @@
|
||||
"integrity": "sha512-XoTaXRqy8EuuHECGS2zFzAeDKoGDtC56VdahnVYTAcDLNo3fceQuXI2KhOSvjnn4Jbkt1UDch7IEuF9Eekf9eg==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@beefast-wxmp/modal-view": {
|
||||
"version": "0.1.9",
|
||||
"resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/modal-view/-/@beefast-wxmp/modal-view-0.1.9.tgz",
|
||||
"integrity": "sha512-29qr37zPaW5BulJP34XIIDEd9TlI+2IfJp4KViTSfjLM+je4K0iLnrJQaQ5EBxrFP/IsLZdI0MwRRe+G1wbLaQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@beefast-wxmp/nav-bar": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/nav-bar/-/@beefast-wxmp/nav-bar-0.0.3.tgz",
|
||||
|
||||
7
package-lock.json
generated
7
package-lock.json
generated
@ -11,6 +11,7 @@
|
||||
"dependencies": {
|
||||
"@beefast-wxmp/img-uploader": "^0.1.6",
|
||||
"@beefast-wxmp/list-view": "^0.0.1",
|
||||
"@beefast-wxmp/modal-view": "^0.1.9",
|
||||
"@beefast-wxmp/nav-bar": "^0.0.3"
|
||||
}
|
||||
},
|
||||
@ -26,6 +27,12 @@
|
||||
"integrity": "sha512-XoTaXRqy8EuuHECGS2zFzAeDKoGDtC56VdahnVYTAcDLNo3fceQuXI2KhOSvjnn4Jbkt1UDch7IEuF9Eekf9eg==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@beefast-wxmp/modal-view": {
|
||||
"version": "0.1.9",
|
||||
"resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/modal-view/-/@beefast-wxmp/modal-view-0.1.9.tgz",
|
||||
"integrity": "sha512-29qr37zPaW5BulJP34XIIDEd9TlI+2IfJp4KViTSfjLM+je4K0iLnrJQaQ5EBxrFP/IsLZdI0MwRRe+G1wbLaQ==",
|
||||
"license": "ISC"
|
||||
},
|
||||
"node_modules/@beefast-wxmp/nav-bar": {
|
||||
"version": "0.0.3",
|
||||
"resolved": "https://packages.aliyun.com/6486fc420ce788fc1c0798b3/npm/repo-glpby/@beefast-wxmp/nav-bar/-/@beefast-wxmp/nav-bar-0.0.3.tgz",
|
||||
|
||||
@ -13,6 +13,7 @@
|
||||
"dependencies": {
|
||||
"@beefast-wxmp/img-uploader": "^0.1.6",
|
||||
"@beefast-wxmp/list-view": "^0.0.1",
|
||||
"@beefast-wxmp/modal-view": "^0.1.9",
|
||||
"@beefast-wxmp/nav-bar": "^0.0.3"
|
||||
}
|
||||
}
|
||||
|
||||
@ -5,42 +5,33 @@
|
||||
<image class="avatar" src="/assets/tabbar/tab3.png" mode="aspectFill"></image>
|
||||
<view class="user-info">
|
||||
<text class="nickname">用户昵称</text>
|
||||
<text class="signature">这是我的个性签名</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 功能入口区 -->
|
||||
<view class="function-list">
|
||||
<view class="list-item">
|
||||
<view class="item-left">
|
||||
<image class="item-icon" src="/assets/tabbar/tab1.png" mode="aspectFit"></image>
|
||||
<text class="item-text">我的收藏</text>
|
||||
<view class="cells cells-access">
|
||||
<view class="cell">
|
||||
<view class="cell-hd">
|
||||
<view class="icon history"></view>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
<view class="cell-bd">我的收藏</view>
|
||||
<view class="cell-ft"></view>
|
||||
</view>
|
||||
|
||||
<view class="list-item">
|
||||
<view class="item-left">
|
||||
<image class="item-icon" src="/assets/tabbar/tab2.png" mode="aspectFit"></image>
|
||||
<text class="item-text">我的搭配</text>
|
||||
<view class="cell">
|
||||
<view class="cell-hd">
|
||||
<view class="icon history"></view>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
<view class="cell-bd">试穿历史</view>
|
||||
<view class="cell-ft"></view>
|
||||
</view>
|
||||
|
||||
<view class="list-item">
|
||||
<view class="item-left">
|
||||
<image class="item-icon" src="/assets/tabbar/tab1.png" mode="aspectFit"></image>
|
||||
<text class="item-text">历史记录</text>
|
||||
|
||||
<view class="cell">
|
||||
<view class="cell-hd">
|
||||
<view class="icon history"></view>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
</view>
|
||||
|
||||
<view class="list-item">
|
||||
<view class="item-left">
|
||||
<image class="item-icon" src="/assets/tabbar/tab2.png" mode="aspectFit"></image>
|
||||
<text class="item-text">设置</text>
|
||||
</view>
|
||||
<view class="arrow"></view>
|
||||
<view class="cell-bd">我的收藏</view>
|
||||
<view class="cell-ft"></view>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@ -1,7 +1,8 @@
|
||||
/* pages/my/index/index.wxss */
|
||||
.container {
|
||||
padding: 0;
|
||||
background-color: #fff;
|
||||
background-color: #f5f5f5;
|
||||
min-height: 100vh;
|
||||
}
|
||||
|
||||
/* 用户信息卡片 */
|
||||
@ -11,7 +12,6 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin-bottom: 20rpx;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
}
|
||||
|
||||
.avatar {
|
||||
@ -40,51 +40,3 @@
|
||||
display: block;
|
||||
}
|
||||
|
||||
/* 功能列表 */
|
||||
.function-list {
|
||||
margin-top: 20rpx;
|
||||
}
|
||||
|
||||
.list-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 30rpx;
|
||||
background: #fff;
|
||||
border-bottom: 1rpx solid #f5f5f5;
|
||||
transition: background-color 0.3s;
|
||||
}
|
||||
|
||||
.list-item:active {
|
||||
background-color: #f9f9f9;
|
||||
}
|
||||
|
||||
.item-left {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
.item-icon {
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
margin-right: 20rpx;
|
||||
color: #FF2727;
|
||||
}
|
||||
|
||||
.item-text {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 400;
|
||||
}
|
||||
|
||||
.arrow {
|
||||
width: 16rpx;
|
||||
height: 16rpx;
|
||||
border-top: 3rpx solid #FF2727;
|
||||
border-right: 3rpx solid #FF2727;
|
||||
transform: rotate(45deg);
|
||||
}
|
||||
|
||||
.list-item:active {
|
||||
background-color: rgba(255, 39, 39, 0.05);
|
||||
}
|
||||
@ -7,6 +7,8 @@ Page({
|
||||
* 页面的初始数据
|
||||
*/
|
||||
data: {
|
||||
isAgree:false,
|
||||
loging:false
|
||||
},
|
||||
|
||||
/**
|
||||
@ -22,6 +24,9 @@ Page({
|
||||
|
||||
},
|
||||
login(){
|
||||
this.setData({
|
||||
loging:true
|
||||
})
|
||||
wx.login({
|
||||
success: (res) => {
|
||||
userAPI.login(res.code).then((data)=>{
|
||||
@ -38,10 +43,19 @@ Page({
|
||||
if(prePage){
|
||||
prePage.onLoad(prePage.options);
|
||||
}
|
||||
}).finally(()=>{
|
||||
this.setData({
|
||||
loging:false
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
},
|
||||
radioChange(event){
|
||||
this.setData({
|
||||
isAgree:!!event.detail.value
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
|
||||
@ -4,5 +4,10 @@
|
||||
</view>
|
||||
|
||||
<view class="bottom">
|
||||
<button class="button" type="primary" bind:tap="login">微信登录</button>
|
||||
<button class="button" type="primary" bind:tap="login" disabled="{{!isAgree}}">微信登录</button>
|
||||
<radio-group bindchange="radioChange" class="radio-group">
|
||||
<label class="radio-item">
|
||||
<radio value="agree" class="radio"/>同意<text class="red">《美搭用户协议》</text>
|
||||
</label>
|
||||
</radio-group>
|
||||
</view>
|
||||
@ -16,5 +16,24 @@
|
||||
width:100%;
|
||||
}
|
||||
.bottom .button{
|
||||
height: 120rpx;
|
||||
border-radius: 60rpx;
|
||||
margin:0 40rpx!important;
|
||||
line-height: 120rpx;
|
||||
padding:0;
|
||||
font-size: 40rpx;
|
||||
}
|
||||
.bottom .radio-group{
|
||||
margin-top:40rpx;
|
||||
}
|
||||
.bottom .radio-group .radio-item{
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
.bottom .radio-group .radio{
|
||||
margin-right: 10rpx;
|
||||
}
|
||||
.bottom .radio-group .red{
|
||||
color: var(--main-color);
|
||||
}
|
||||
@ -20,20 +20,32 @@ Page({
|
||||
currentHistory:{},
|
||||
|
||||
hasTryon:false,
|
||||
personImageUploading:false
|
||||
personImageUploading:false,
|
||||
|
||||
isViewPersonImage:false,
|
||||
|
||||
isShowComment:false,
|
||||
tryonComment:{},
|
||||
tryonCommentLoading:false,
|
||||
|
||||
pageHeight:0,
|
||||
|
||||
tryonStatus:userAPI.tryOnStatus
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面加载
|
||||
*/
|
||||
onLoad(options) {
|
||||
console.log(options);
|
||||
const windowInfo = wx.getWindowInfo();
|
||||
console.log(windowInfo);
|
||||
const imgWidth = windowInfo.windowWidth - rpxToPx(80);
|
||||
const imgHeight = imgWidth*4/3;
|
||||
console.log(imgWidth,imgHeight);
|
||||
this.setData({
|
||||
imgHeight
|
||||
imgHeight,
|
||||
pageHeight:windowInfo.screenHeight
|
||||
})
|
||||
this.getDefaultPersonImage();
|
||||
this.getHistory();
|
||||
@ -42,7 +54,7 @@ Page({
|
||||
userAPI.tryonHistory().then((data)=>{
|
||||
let hasTryon = false;
|
||||
data.map((item)=>{
|
||||
if(!item.completion_url&&item.status!='失败'){
|
||||
if(!item.completion_url&&item.status!=userAPI.tryOnStatus.error){
|
||||
hasTryon = true;
|
||||
this.checkResult(item.id)
|
||||
}
|
||||
@ -90,16 +102,17 @@ Page({
|
||||
|
||||
chooseTopClothing(){
|
||||
if(this.data.currentHistory&&this.data.currentHistory.id){
|
||||
return;
|
||||
this.viewImage(this.data.currentHistory.top_clothing_url);
|
||||
}else{
|
||||
this.chooseAndUpload('topClothing');
|
||||
}
|
||||
this.chooseAndUpload('topClothing');
|
||||
},
|
||||
chooseBottomClothing(){
|
||||
if(this.data.currentHistory&&this.data.currentHistory.id){
|
||||
return;
|
||||
this.viewImage(this.data.currentHistory.bottom_clothing_url);
|
||||
}else{
|
||||
this.chooseAndUpload('bottomClothing');
|
||||
}
|
||||
this.chooseAndUpload('bottomClothing');
|
||||
|
||||
},
|
||||
|
||||
chooseAndUpload(key){
|
||||
@ -138,6 +151,10 @@ Page({
|
||||
top_clothing_url:this.data.topClothing.serverUrl,
|
||||
bottom_clothing_url:this.data.bottomClothing.serverUrl
|
||||
}).then((data)=>{
|
||||
this.setData({
|
||||
topClothing:{},
|
||||
bottomClothing:{}
|
||||
})
|
||||
this.getHistory();
|
||||
}).finally(()=>{
|
||||
this.setData({
|
||||
@ -152,7 +169,7 @@ Page({
|
||||
})
|
||||
setTimeout(()=>{
|
||||
userAPI.checkTryon(id).then((data)=>{
|
||||
if(data.completion_url){
|
||||
if(data.completion_url||data.status==userAPI.tryOnStatus.error){
|
||||
this.getHistory();
|
||||
}else{
|
||||
this.checkResult(id);
|
||||
@ -191,6 +208,44 @@ Page({
|
||||
}
|
||||
})
|
||||
},
|
||||
viewPersonImage(){
|
||||
this.setData({
|
||||
isViewPersonImage:true
|
||||
})
|
||||
},
|
||||
viewCompleteImage(){
|
||||
this.setData({
|
||||
isViewPersonImage:false
|
||||
})
|
||||
},
|
||||
showComment(){
|
||||
if(this.data.tryonCommentLoading)return;
|
||||
this.setData({
|
||||
tryonCommentLoading:true
|
||||
})
|
||||
userAPI.getTryonComment(this.data.currentHistory.id).then((data)=>{
|
||||
wx.hideTabBar({
|
||||
success:()=>{
|
||||
this.setData({
|
||||
isShowComment:true,
|
||||
tryonComment:data
|
||||
})
|
||||
}
|
||||
});
|
||||
}).finally(()=>{
|
||||
this.setData({
|
||||
tryonCommentLoading:false
|
||||
})
|
||||
})
|
||||
},
|
||||
commentViewLeave(){
|
||||
wx.showTabBar();
|
||||
wx.rewriteRoute({
|
||||
url:'/pages/try/index/index',
|
||||
preserveQuery:true
|
||||
});
|
||||
this.options.shared_history_id = '';
|
||||
},
|
||||
|
||||
/**
|
||||
* 生命周期函数--监听页面初次渲染完成
|
||||
@ -202,7 +257,19 @@ Page({
|
||||
/**
|
||||
* 生命周期函数--监听页面显示
|
||||
*/
|
||||
onShow(options) {
|
||||
onShow() {
|
||||
if(this.options&&this.options.shared_history_id){
|
||||
userAPI.tryonDetail(this.options.shared_history_id).then((data)=>{
|
||||
wx.hideTabBar({
|
||||
success:()=>{
|
||||
this.setData({
|
||||
isShowComment:true,
|
||||
tryonComment:data
|
||||
})
|
||||
}
|
||||
});
|
||||
})
|
||||
}
|
||||
},
|
||||
getDefaultPersonImage(){
|
||||
userAPI.getDefaultPersonImage().then((data)=>{
|
||||
@ -229,6 +296,14 @@ Page({
|
||||
currentHistory:{}
|
||||
})
|
||||
},
|
||||
viewImageInView(event){
|
||||
this.viewImage(event.currentTarget.dataset.item);
|
||||
},
|
||||
viewImage(url){
|
||||
wx.previewImage({
|
||||
urls: [url],
|
||||
})
|
||||
},
|
||||
/**
|
||||
* 生命周期函数--监听页面隐藏
|
||||
*/
|
||||
@ -261,6 +336,12 @@ Page({
|
||||
* 用户点击右上角分享
|
||||
*/
|
||||
onShareAppMessage() {
|
||||
|
||||
if(this.data.currentHistory.id){
|
||||
return {
|
||||
title:'美搭,美达,美美哒',
|
||||
imageUrl:this.data.currentHistory.completion_url,
|
||||
path:`/pages/try/index/index?shared_history_id=${this.data.currentHistory.id}`
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
@ -1,6 +1,7 @@
|
||||
{
|
||||
"usingComponents": {
|
||||
"nav-bar":"/miniprogram_npm/@beefast-wxmp/nav-bar"
|
||||
"nav-bar":"/miniprogram_npm/@beefast-wxmp/nav-bar",
|
||||
"modal-view":"/miniprogram_npm/@beefast-wxmp/modal-view"
|
||||
},
|
||||
"navigationStyle": "custom"
|
||||
}
|
||||
@ -11,8 +11,15 @@
|
||||
</view>
|
||||
<view class="main" style="height:{{imgHeight}}px">
|
||||
<block wx:if="{{defaultPersonImage}}">
|
||||
<image class="person-image" src="{{currentHistory.completion_url}}" mode="aspectFit"
|
||||
wx:if="{{currentHistory.id}}"/>
|
||||
<!--
|
||||
isViewPersonImage:长按显示模特照片,松开显示生成的照片,如果生成失败,就还是显示模特照片
|
||||
-->
|
||||
<image class="person-image" mode="aspectFit"
|
||||
src="{{isViewPersonImage?currentHistory.person_image.image_url:(currentHistory.completion_url||currentHistory.person_image.image_url)}}"
|
||||
data-item="{{isViewPersonImage?currentHistory.person_image.image_url:(currentHistory.completion_url||currentHistory.person_image.image_url)}}"
|
||||
wx:if="{{currentHistory.id}}" bind:longpress="viewPersonImage"
|
||||
bind:tap="viewImageInView"
|
||||
bind:touchcancel="viewCompleteImage" bind:touchend="viewCompleteImage"/>
|
||||
<image class="person-image" src="{{defaultPersonImage}}" mode="aspectFit" wx:else/>
|
||||
</block>
|
||||
<block wx:else>
|
||||
@ -52,9 +59,14 @@
|
||||
</view>
|
||||
</view>
|
||||
<view class="bottom" wx:if="{{defaultPersonImage}}">
|
||||
<block wx:if="{{currentHistory.id}}">
|
||||
<button type="primary" bind:tap="showComment" wx:if="{{currentHistory.completion_url}}"
|
||||
loading="{{tryonCommentLoading}}">查看 AI 点评</button>
|
||||
<button type="primary" wx:else disabled>生成失败</button>
|
||||
</block>
|
||||
<button type="primary" bind:tap="tryon"
|
||||
loading="{{hasTryon||trying}}"
|
||||
disabled="{{hasTryon||trying||currentHistory.id}}">
|
||||
disabled="{{hasTryon||trying}}" wx:else>
|
||||
{{hasTryon||trying?'请等待上一个试穿任务':'立刻试穿'}}
|
||||
</button>
|
||||
</view>
|
||||
@ -70,7 +82,7 @@
|
||||
<block wx:else>
|
||||
<image src="{{item.top_clothing_url}}" class="top-img"/>
|
||||
<image src="{{item.bottom_clothing_url}}" class="bottom-img"/>
|
||||
<view class="error-area" wx:if="{{item.status=='失败'}}">
|
||||
<view class="error-area" wx:if="{{item.status==tryonStatus.error}}">
|
||||
<view type="warn" size="60rpx" class="icon warn"><view class="dispatch"/></view>
|
||||
<view class="tips">失败</view>
|
||||
</view>
|
||||
@ -78,9 +90,20 @@
|
||||
<view class="icon loading"></view>
|
||||
</view>
|
||||
</block>
|
||||
<view class="delete-area" capture-catch:tap="deleteHistory" data-item="{{item}}">
|
||||
<!-- <view class="delete-area" capture-catch:tap="deleteHistory" data-item="{{item}}">
|
||||
<view class="icon delete"></view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</scroll-view>
|
||||
</scroll-view>
|
||||
</scroll-view>
|
||||
|
||||
<modal-view show="{{isShowComment}}" class="comment-modal-view" pageHeight="{{pageHeight}}"
|
||||
isShowCancel="{{false}}" isShowOk="{{false}}" bind:afterLeave="commentViewLeave" showCloseButton>
|
||||
<image src="{{tryonComment.completion_url}}" class="main-img" mode="aspectFill"/>
|
||||
<view class="comment">
|
||||
<view class="point">{{tryonComment.score}}</view>
|
||||
<view class="cmt-title">AI 点评:</view>
|
||||
<view class="cmt-content">{{tryonComment.comment}}</view>
|
||||
<button class="button" type="primary" bind:tap="share" open-type="share">分享</button>
|
||||
</view>
|
||||
</modal-view>
|
||||
@ -4,7 +4,7 @@
|
||||
box-sizing: border-box;
|
||||
}
|
||||
.try-container .header{
|
||||
font-size: 40rpx;
|
||||
font-size: 52rpx;
|
||||
font-weight: bold;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
@ -169,4 +169,76 @@
|
||||
font-size: 40rpx;
|
||||
margin-left:-20rpx;
|
||||
margin-top:-20rpx;
|
||||
}
|
||||
|
||||
.comment-modal-view .modal-view-main{
|
||||
padding:0;
|
||||
overflow: hidden;
|
||||
}
|
||||
.comment-modal-view .modal-view-main .close-btn-area{
|
||||
right:0;top:0;
|
||||
}
|
||||
.comment-modal-view .modal-view-main .close-btn-area .close-btn{
|
||||
content: '';
|
||||
top:0;left:0;
|
||||
border-radius: 50%;
|
||||
background-color: rgba(0, 0, 0, .2);
|
||||
}
|
||||
.comment-modal-view .modal-view-main .close-btn-area .close-btn::after{
|
||||
width:1em;height:1em;
|
||||
-webkit-mask-position:0 0;
|
||||
mask-position:0 0;
|
||||
-webkit-mask-repeat:no-repeat;
|
||||
mask-repeat:no-repeat;
|
||||
-webkit-mask-size:100%;
|
||||
mask-size:100%;
|
||||
background-color:currentColor;
|
||||
color: #ddd;
|
||||
mask-image: var(--icon-plus);
|
||||
-webkit-mask-image: var(--icon-plus);
|
||||
font-size: 36rpx;
|
||||
transform: rotate(45deg);
|
||||
left:10rpx;
|
||||
top:8rpx;
|
||||
}
|
||||
.comment-modal-view .modal-view-main .close-btn-area .close-btn::before{
|
||||
display: none;
|
||||
}
|
||||
.comment-modal-view .modal-view-main .main-img{
|
||||
width:100%;
|
||||
/* 54是弹出框左右的宽度 */
|
||||
height:calc((100vw - 54px)*4/3);
|
||||
}
|
||||
.comment-modal-view .modal-view-main .comment{
|
||||
padding:40rpx;
|
||||
}
|
||||
.comment-modal-view .modal-view-main .point{
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: baseline;
|
||||
|
||||
color:var(--main-color);
|
||||
font-size: 70rpx;
|
||||
line-height: 70rpx;
|
||||
font-weight: bold;
|
||||
}
|
||||
.comment-modal-view .modal-view-main .point::after{
|
||||
content:'分';
|
||||
line-height: 30rpx;
|
||||
font-size: 30rpx;
|
||||
font-weight: normal;
|
||||
margin-left:10rpx;
|
||||
color: var(--main-font-color);
|
||||
}
|
||||
.comment-modal-view .cmt-title{
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
margin:20rpx 0;
|
||||
}
|
||||
.comment-modal-view .cmt-content{
|
||||
line-height: 40rpx;
|
||||
text-indent: 2em;
|
||||
}
|
||||
.comment-modal-view .button{
|
||||
margin-top:40rpx;
|
||||
}
|
||||
@ -3,5 +3,18 @@
|
||||
"projectname": "meida",
|
||||
"setting": {
|
||||
"compileHotReLoad": true
|
||||
},
|
||||
"condition": {
|
||||
"miniprogram": {
|
||||
"list": [
|
||||
{
|
||||
"name": "pages/try/index/index",
|
||||
"pathName": "pages/try/index/index",
|
||||
"query": "shared_history_id=33",
|
||||
"launchMode": "default",
|
||||
"scene": null
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue
Block a user