diff --git a/api/request.js b/api/request.js
index 5e20ad3..d6523a3 100644
--- a/api/request.js
+++ b/api/request.js
@@ -50,6 +50,7 @@ class Request {
return response;
}
}
+ console.log(response);
throw new Error(response.data)
});
}
@@ -93,7 +94,7 @@ class Request {
if(!config.ignoreError){
wx.showToast({
icon:'error',
- title: response.data.message||'未知错误',
+ title: res.data.message||'未知错误',
})
}
reject(error);
diff --git a/app.json b/app.json
index e2a918d..58d37bd 100644
--- a/app.json
+++ b/app.json
@@ -6,7 +6,8 @@
"pages/closet/index/index",
"pages/my/index/index",
"pages/my/setting/index",
- "pages/my/setting/name/index"
+ "pages/my/setting/name/index",
+ "pages/my/history/list"
],
"window": {
"navigationBarTextStyle": "black",
@@ -14,20 +15,22 @@
"navigationBarBackgroundColor": "#ffffff"
},
"tabBar": {
- "selectedColor": "#FF2727",
+ "color": "#999",
+ "selectedColor": "#000000",
+ "borderStyle": "black",
"list": [
- {
- "pagePath": "pages/closet/index/index",
- "text": "衣橱",
- "iconPath": "/assets/tabbar/tab1.png",
- "selectedIconPath": "/assets/tabbar/tab1-active.png"
- },
{
"pagePath": "pages/try/index/index",
"text": "试衣间",
"iconPath": "/assets/tabbar/tab2.png",
"selectedIconPath": "/assets/tabbar/tab2-active.png"
},
+ {
+ "pagePath": "pages/closet/index/index",
+ "text": "衣橱",
+ "iconPath": "/assets/tabbar/tab1.png",
+ "selectedIconPath": "/assets/tabbar/tab1-active.png"
+ },
{
"pagePath": "pages/my/index/index",
"text": "我的",
diff --git a/app.wxss b/app.wxss
index b9c731a..a6e133e 100644
--- a/app.wxss
+++ b/app.wxss
@@ -1,6 +1,7 @@
@import './assets/icon.wxss';
page{
- --main-color:#FF2727;
+ /* --main-color:#FF2727; */
+ --main-color:#000;
--main-bgclolor:#ffffff;
--main-font-color:#333;
--safe-bottom:constant(safe-area-inset-bottom);
@@ -26,7 +27,7 @@ button{
border-radius: 80rpx;
background-color: #000;
color: #fff;
- transition-duration: .4s;
+ /* transition-duration: .4s; */
margin:0;
}
wx-button:not([size=mini]){
diff --git a/assets/icon.wxss b/assets/icon.wxss
index 9e6b6c6..8ea9fd1 100644
--- a/assets/icon.wxss
+++ b/assets/icon.wxss
@@ -55,6 +55,14 @@
mask-image: var(--icon-history);
-webkit-mask-image: var(--icon-history);
}
+.icon.more{
+ mask-image: var(--icon-more);
+ -webkit-mask-image: var(--icon-more);
+}
+.icon.lajitong{
+ mask-image: var(--icon-lajitong);
+ -webkit-mask-image: var(--icon-lajitong);
+}
.icon.warn{
position: relative;
background-color: #fff;
@@ -86,5 +94,7 @@ page{
--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-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);
- --icon-close:url(data:image/svg+xml,%3Csvg%20t%3D%221744706202919%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%2260727%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Cpath%20d%3D%22M942.506667%200L512%20430.506667%2081.493333%200%200%2081.493333%20430.506667%20512%200%20942.506667%2081.493333%201024%20512%20593.493333%20942.506667%201024%201024%20942.506667%20593.493333%20512%201024%2081.493333%20942.506667%200z%22%20fill%3D%22%23000000%22%20p-id%3D%2260728%22%3E%3C/path%3E%3C/svg%3E)
+ --icon-close:url(data:image/svg+xml,%3Csvg%20t%3D%221744706202919%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%2260727%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Cpath%20d%3D%22M942.506667%200L512%20430.506667%2081.493333%200%200%2081.493333%20430.506667%20512%200%20942.506667%2081.493333%201024%20512%20593.493333%20942.506667%201024%201024%20942.506667%20593.493333%20512%201024%2081.493333%20942.506667%200z%22%20fill%3D%22%23000000%22%20p-id%3D%2260728%22%3E%3C/path%3E%3C/svg%3E);
+ --icon-more:url(data:image/svg+xml,%3Csvg%20t%3D%221744806307165%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%2267903%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Cpath%20d%3D%22M227.14123%20413.647995c-52.14973%200-94.587262%2042.439578-94.587262%2094.587262%200%2052.14973%2042.437531%2094.587262%2094.587262%2094.587262%2052.147684%200%2094.587262-42.437531%2094.587262-94.587262C321.728492%20456.087573%20279.288914%20413.647995%20227.14123%20413.647995z%22%20fill%3D%22%23272636%22%20p-id%3D%2267904%22%3E%3C/path%3E%3Cpath%20d%3D%22M510.903016%20413.647995c-52.14973%200-94.587262%2042.439578-94.587262%2094.587262%200%2052.14973%2042.437531%2094.587262%2094.587262%2094.587262%2052.147684%200%2094.587262-42.437531%2094.587262-94.587262C605.490278%20456.087573%20563.051723%20413.647995%20510.903016%20413.647995z%22%20fill%3D%22%23272636%22%20p-id%3D%2267905%22%3E%3C/path%3E%3Cpath%20d%3D%22M794.665825%20413.647995c-52.14973%200-94.587262%2042.439578-94.587262%2094.587262%200%2052.14973%2042.437531%2094.587262%2094.587262%2094.587262%2052.147684%200%2094.587262-42.437531%2094.587262-94.587262C889.253086%20456.087573%20846.813508%20413.647995%20794.665825%20413.647995z%22%20fill%3D%22%23272636%22%20p-id%3D%2267906%22%3E%3C/path%3E%3C/svg%3E);
+ --icon-lajitong:url(data:image/svg+xml,%3Csvg%20t%3D%221744885965978%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%2269978%22%20width%3D%22128%22%20height%3D%22128%22%3E%3Cpath%20d%3D%22M844.8%20326.4c-19.2%200-38.4%2019.2-38.4%2038.4v550.4c0%2019.2-19.2%2038.4-38.4%2038.4H256c-19.2%200-38.4-19.2-38.4-38.4V364.8c0-19.2-12.8-38.4-38.4-38.4-19.2%200-38.4%2019.2-38.4%2038.4v550.4c6.4%2057.6%2051.2%20108.8%20115.2%20108.8h512c64%200%20115.2-51.2%20115.2-115.2V364.8c0-19.2-19.2-38.4-38.4-38.4z%20m-409.6%20435.2V364.8c0-19.2-12.8-38.4-38.4-38.4-19.2%200-38.4%2019.2-38.4%2038.4V768c0%2019.2%2012.8%2038.4%2038.4%2038.4%2025.6-6.4%2038.4-19.2%2038.4-44.8z%20m224%200V364.8c0-19.2-19.2-38.4-38.4-38.4s-38.4%2019.2-38.4%2038.4V768c0%2019.2%2019.2%2038.4%2038.4%2038.4%2019.2-6.4%2038.4-19.2%2038.4-44.8z%20m326.4-582.4h-179.2V108.8c0-57.6-51.2-108.8-108.8-108.8H326.4c-64%200-108.8%2044.8-108.8%20108.8v76.8H38.4c-19.2-6.4-38.4%2012.8-38.4%2032s19.2%2032%2038.4%2032h947.2c19.2%200%2038.4-12.8%2038.4-32s-19.2-38.4-38.4-38.4z%20m-256%200H288V108.8c0-19.2%2019.2-38.4%2038.4-38.4h371.2c19.2%200%2032%2012.8%2032%2038.4v70.4z%20m0%200%22%20fill%3D%22%23383838%22%20p-id%3D%2269979%22%3E%3C/path%3E%3C/svg%3E)
}
\ No newline at end of file
diff --git a/assets/tabbar/_tab1-active.png b/assets/tabbar/_tab1-active.png
new file mode 100644
index 0000000..9cf700c
Binary files /dev/null and b/assets/tabbar/_tab1-active.png differ
diff --git a/assets/tabbar/_tab1.png b/assets/tabbar/_tab1.png
new file mode 100644
index 0000000..d7480c2
Binary files /dev/null and b/assets/tabbar/_tab1.png differ
diff --git a/assets/tabbar/_tab2-active.png b/assets/tabbar/_tab2-active.png
new file mode 100644
index 0000000..cd4ba9e
Binary files /dev/null and b/assets/tabbar/_tab2-active.png differ
diff --git a/assets/tabbar/_tab2.png b/assets/tabbar/_tab2.png
new file mode 100644
index 0000000..19df5ea
Binary files /dev/null and b/assets/tabbar/_tab2.png differ
diff --git a/assets/tabbar/_tab3-active.png b/assets/tabbar/_tab3-active.png
new file mode 100644
index 0000000..a383bd0
Binary files /dev/null and b/assets/tabbar/_tab3-active.png differ
diff --git a/assets/tabbar/_tab3.png b/assets/tabbar/_tab3.png
new file mode 100644
index 0000000..e06a03b
Binary files /dev/null and b/assets/tabbar/_tab3.png differ
diff --git a/assets/tabbar/tab1-active.png b/assets/tabbar/tab1-active.png
index 9cf700c..8aae119 100644
Binary files a/assets/tabbar/tab1-active.png and b/assets/tabbar/tab1-active.png differ
diff --git a/assets/tabbar/tab1.png b/assets/tabbar/tab1.png
index d7480c2..3f92831 100644
Binary files a/assets/tabbar/tab1.png and b/assets/tabbar/tab1.png differ
diff --git a/assets/tabbar/tab2-active.png b/assets/tabbar/tab2-active.png
index cd4ba9e..c9c65fd 100644
Binary files a/assets/tabbar/tab2-active.png and b/assets/tabbar/tab2-active.png differ
diff --git a/assets/tabbar/tab2.png b/assets/tabbar/tab2.png
index 19df5ea..283b6af 100644
Binary files a/assets/tabbar/tab2.png and b/assets/tabbar/tab2.png differ
diff --git a/assets/tabbar/tab3-active.png b/assets/tabbar/tab3-active.png
index a383bd0..b518d47 100644
Binary files a/assets/tabbar/tab3-active.png and b/assets/tabbar/tab3-active.png differ
diff --git a/assets/tabbar/tab3.png b/assets/tabbar/tab3.png
index e06a03b..1f280b9 100644
Binary files a/assets/tabbar/tab3.png and b/assets/tabbar/tab3.png differ
diff --git a/component/share-modal-view/index.js b/component/share-modal-view/index.js
new file mode 100644
index 0000000..ac29103
--- /dev/null
+++ b/component/share-modal-view/index.js
@@ -0,0 +1,60 @@
+// component/share-modal-view.js
+Component({
+
+ externalClasses:'custom-class',
+ /**
+ * 组件的属性列表
+ */
+ properties: {
+ show:{
+ type:Boolean,
+ value:false
+ },
+ data:Object,
+ buttonType:String,
+ pageHeight:Number
+ },
+
+ /**
+ * 组件的初始数据
+ */
+ data: {
+ maxHeight:0
+ },
+
+ /**
+ * 组件的方法列表
+ */
+ methods: {
+ tryon(){
+ this.triggerEvent('tryon')
+ },
+ share(){
+ const pages = getCurrentPages();
+ const currentPage = pages[pages.length - 1];
+ currentPage.onShareAppMessage = ()=>{
+ return {
+ title:'我的美搭,分享给你',
+ imageUrl:this.properties.data.completion_url,
+ path:`/pages/try/index/index?shared_history_id=${this.properties.data.id}`
+ }
+ }
+ },
+ afterLeave(){
+ this.triggerEvent('afterLeave')
+ },
+ closeModal(){
+ this.selectComponent('#modalView').cancelButtonTap();
+ }
+ },
+ lifetimes:{
+ ready(){
+ const windowInfo = wx.getWindowInfo();
+ console.log(this.properties.pageHeight,windowInfo.windowHeight);
+ this.setData({
+ maxHeight:(this.properties.pageHeight||windowInfo.windowHeight)-40
+ })
+ }
+ }
+
+})
\ No newline at end of file
diff --git a/component/share-modal-view/index.json b/component/share-modal-view/index.json
new file mode 100644
index 0000000..73f7697
--- /dev/null
+++ b/component/share-modal-view/index.json
@@ -0,0 +1,7 @@
+{
+ "component": true,
+ "styleIsolation": "page-shared",
+ "usingComponents": {
+ "modal-view":"/miniprogram_npm/@beefast-wxmp/modal-view"
+ }
+}
\ No newline at end of file
diff --git a/component/share-modal-view/index.wxml b/component/share-modal-view/index.wxml
new file mode 100644
index 0000000..4fb95d1
--- /dev/null
+++ b/component/share-modal-view/index.wxml
@@ -0,0 +1,24 @@
+
diff --git a/component/share-modal-view/index.wxss b/component/share-modal-view/index.wxss
new file mode 100644
index 0000000..214df03
--- /dev/null
+++ b/component/share-modal-view/index.wxss
@@ -0,0 +1,124 @@
+.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 .close-area{
+ position:absolute;
+ right:0;top:0;
+ background-color: rgba(0, 0, 0, .2);
+ width:70rpx;height:70rpx;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ color: #fff;
+ border-radius: 50%;
+}
+.comment-modal-view .modal-view-main .image-area{
+ width:100%;
+ /* 54是弹出框左右的宽度 */
+ height:calc((100vw - 54px)*4/3);
+ /* flex:1; */
+ position: relative;
+}
+.comment-modal-view .modal-view-main .image-area .image{
+ width:100%;height:100%;
+ vertical-align: middle;
+}
+.comment-modal-view .modal-view-main .image-area .top-bottom{
+ position: absolute;
+ bottom:20rpx;
+ left:20rpx;
+ display: flex;
+ flex-direction: column;
+ gap: 20rpx;
+}
+.comment-modal-view .modal-view-main .image-area .top,
+.comment-modal-view .modal-view-main .image-area .bottom{
+ width:140rpx;
+ height:140rpx;
+ border-radius: 20rpx;
+}
+.comment-modal-view .modal-view-main .comment{
+ padding:40rpx;
+ position: relative;
+}
+.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;
+}
+.comment-container{
+ display: flex;
+ flex-direction: column;
+}
+
+@media (min-aspect-ratio:5/9){
+ .comment-modal-view .modal-view-main .comment{
+ padding:20rpx;
+ }
+ .comment-modal-view .modal-view-main .point{
+ position:absolute;
+ left:160rpx;
+ top:22rpx;
+ font-size: 40rpx;
+ }
+}
+/* @media (min-aspect-ratio:3/5){ */
+ /* .comment-modal-view .modal-view-main .image-area{
+ height:calc(100vw - 54px);
+ } */
+/* } */
\ No newline at end of file
diff --git a/pages/closet/index/index.js b/pages/closet/index/index.js
index fff6ca5..b98f55a 100644
--- a/pages/closet/index/index.js
+++ b/pages/closet/index/index.js
@@ -22,10 +22,16 @@ Page({
hasDefaultImage:false,
topClothingCId:'',
- bottomClothingCId:''
+ bottomClothingCId:'',
+
+ statusBarHeight:0
},
onLoad() {
+ const windowInfo = wx.getWindowInfo();
+ this.setData({
+ statusBarHeight:windowInfo.statusBarHeight,
+ })
this.loadClosetList();
clothingAPI.getCategories().then((data)=>{
data.map((item)=>{
@@ -104,7 +110,8 @@ Page({
},
addClothing(){
this.setData({
- isShowUploader:true
+ isShowUploader:true,
+ uploadImg:{}
})
},
chooseImg(){
diff --git a/pages/closet/index/index.wxml b/pages/closet/index/index.wxml
index bb466c5..01bae76 100644
--- a/pages/closet/index/index.wxml
+++ b/pages/closet/index/index.wxml
@@ -2,9 +2,9 @@
diff --git a/pages/my/index/index.wxss b/pages/my/index/index.wxss
index c943a57..c061fbf 100644
--- a/pages/my/index/index.wxss
+++ b/pages/my/index/index.wxss
@@ -38,7 +38,7 @@
flex-direction: column;
align-items:flex-start;
justify-content: center;
- padding:20rpx 0;
+ padding:10rpx 0;
}
.share .cell-bd .title{
font-weight: bold;
@@ -49,7 +49,14 @@
margin-top:30rpx;
}
.share .count{
- color:var(--main-color);
+ color:red;
margin:0 10rpx;
font-weight: bold;
+}
+
+.cell.button{
+ background-color: transparent;
+ width:auto!important;
+ color:var(--main-font-color);
+ font-weight: normal;
}
\ No newline at end of file
diff --git a/pages/my/setting/index.json b/pages/my/setting/index.json
index e8c2c06..e1619f7 100644
--- a/pages/my/setting/index.json
+++ b/pages/my/setting/index.json
@@ -1,4 +1,4 @@
{
"usingComponents": {},
- "navigationBarTitleText": "设置"
+ "navigationBarTitleText": "个人设置"
}
\ No newline at end of file
diff --git a/pages/my/setting/index.wxml b/pages/my/setting/index.wxml
index 4ace838..44d6bf4 100644
--- a/pages/my/setting/index.wxml
+++ b/pages/my/setting/index.wxml
@@ -15,7 +15,7 @@
-
+
+
diff --git a/pages/try/index/index.js b/pages/try/index/index.js
index aa63a15..56ad27d 100644
--- a/pages/try/index/index.js
+++ b/pages/try/index/index.js
@@ -1,10 +1,11 @@
import userAPI from "../../../api/user";
import commonAPI from "../../../api/common";
import {rpxToPx} from '../../../utils/util';
+const app = getApp();
// pages/try/index/index.js
Page({
-
+ useCustomShare:true,
/**
* 页面的初始数据
*/
@@ -36,7 +37,11 @@ Page({
userInfo:{},
- hasMultiPersonImages:false
+ hasMultiPersonImages:false,
+
+ statusBarHeight:0,
+
+ userCode:''
},
/**
@@ -44,17 +49,36 @@ Page({
*/
onLoad(options) {
const windowInfo = wx.getWindowInfo();
- console.log(windowInfo);
const imgWidth = windowInfo.windowWidth - rpxToPx(80);
const imgHeight = imgWidth*4/3;
this.setData({
imgHeight,
+ statusBarHeight:windowInfo.statusBarHeight,
pageHeight:windowInfo.screenHeight
})
- this.getHistory();
- this.getUserInfo();
- this.getPersonImages();
+
+ if(wx.getStorageSync('token')){
+ this.getHistory();
+ this.getUserInfo();
+ this.getPersonImages();
+ }else{
+ wx.showLoading({
+ title: '请等待...',
+ mask:true
+ })
+ wx.login({
+ success: (res) => {
+ userAPI.login(res.code,this.data.userCode).then((data)=>{
+ wx.hideLoading();
+ wx.setStorageSync('token', data.access_token);
+ this.onLoad(this.options);
+ this.onShow();
+ })
+ },
+ })
+ }
},
+ //目前用于查看历史条数,用于显示添加或者修改形象按钮
getPersonImages(){
userAPI.getPersonImages({skip:0,limit:2}).then((data)=>{
this.setData({
@@ -63,7 +87,9 @@ Page({
})
},
getHistory(){
- userAPI.tryonHistory().then((data)=>{
+ userAPI.tryonHistory({
+ skip:0,limit:10
+ }).then((data)=>{
let hasTryon = false;
data.map((item)=>{
if(!item.completion_url&&item.status!=userAPI.tryOnStatus.error){
@@ -153,6 +179,7 @@ Page({
tryon(){
if(!this.data.topClothing.serverUrl&&!this.data.bottomClothing.serverUrl){
wx.showToast({
+ icon:'none',
title: '请先选择衣服',
})
return;
@@ -166,7 +193,8 @@ Page({
}).then((data)=>{
this.setData({
topClothing:{},
- bottomClothing:{}
+ bottomClothing:{},
+ "userInfo.tryon_remain_count":data.tryon_remain_count
})
this.getHistory();
}).finally(()=>{
@@ -200,6 +228,8 @@ Page({
addNew(){
this.setData({
+ topClothing:{},
+ bottomClothing:{},
currentHistory:{}
})
},
@@ -232,6 +262,7 @@ Page({
})
},
showComment(){
+ // const commentViewHeight = 40+35+38+
if(this.data.tryonCommentLoading)return;
this.setData({
tryonCommentLoading:true
@@ -253,14 +284,16 @@ Page({
},
commentViewLeave(){
wx.showTabBar();
+ this.setData({
+ shared_history_id:''
+ })
+ if(this.options){
+ this.options.shared_history_id = '';
+ }
wx.rewriteRoute({
url:'/pages/try/index/index',
preserveQuery:true
});
- this.setData({
- shared_history_id:''
- })
- this.options.shared_history_id = '';
},
/**
@@ -282,7 +315,14 @@ Page({
* 生命周期函数--监听页面显示
*/
onShow() {
+ this.setData({
+ userCode:app.globalData.shared_user_code||''
+ })
+ if(!wx.getStorageSync('token')){
+ return;
+ }
this.getDefaultPersonImage();
+ this.getPersonImages();
if(this.options&&this.options.shared_history_id){
userAPI.tryonDetail(this.options.shared_history_id).then((data)=>{
wx.hideTabBar({
@@ -309,6 +349,10 @@ Page({
this.setData({
defaultPersonImage:data.image_url
})
+ }).catch(()=>{
+ this.setData({
+ defaultPersonImage:''
+ })
});
},
setTop(url){
@@ -342,6 +386,16 @@ Page({
url: '/pages/my/images/index?auto_back=true',
})
},
+ showChooseImageAS(){
+ wx.showActionSheet({
+ itemList: ['更换形象照'],
+ success:(res)=>{
+ if(res.tapIndex==0){
+ this.navToPersonImage()
+ }
+ }
+ })
+ },
/**
* 生命周期函数--监听页面隐藏
*/
@@ -376,7 +430,7 @@ Page({
onShareAppMessage() {
if(this.data.currentHistory.id){
return {
- title:'美搭,美达,美美哒',
+ title:'我的美搭,分享给你',
imageUrl:this.data.currentHistory.completion_url,
path:`/pages/try/index/index?shared_history_id=${this.data.currentHistory.id}`
}
diff --git a/pages/try/index/index.json b/pages/try/index/index.json
index 5e4ec41..e05e119 100644
--- a/pages/try/index/index.json
+++ b/pages/try/index/index.json
@@ -1,7 +1,8 @@
{
"usingComponents": {
"nav-bar":"/miniprogram_npm/@beefast-wxmp/nav-bar",
- "modal-view":"/miniprogram_npm/@beefast-wxmp/modal-view"
+ "modal-view":"/miniprogram_npm/@beefast-wxmp/modal-view",
+ "share-modal-view":"/component/share-modal-view"
},
"navigationStyle": "custom"
}
\ No newline at end of file
diff --git a/pages/try/index/index.wxml b/pages/try/index/index.wxml
index 320333d..1dd656c 100644
--- a/pages/try/index/index.wxml
+++ b/pages/try/index/index.wxml
@@ -1,18 +1,9 @@
-
@@ -20,19 +11,32 @@
isViewPersonImage:长按显示模特照片,松开显示生成的照片,如果生成失败,就还是显示模特照片
-->
-
+
+
+
+
+
-
+
+
+
+
+
-
-
+
+ 添加形象照
+
查看 AI 点评
生成失败
- {{hasTryon||trying?'请等待上一个试穿任务':'立刻试穿(剩余:'+userInfo.tryon_remain_count+'次)'}}
+ loading="{{trying}}"
+ disabled="{{trying||userInfo.tryon_remain_count<1}}" wx:else>
+ 立刻试穿(剩余:{{userInfo.tryon_remain_count}}次)
-
+
-
-
-
-
-
-
-
- 失败
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+ 失败
+
+
+
+
+
+
+
+
+
+ 更多
+
+
+
+
-
+
+
\ No newline at end of file
diff --git a/pages/try/index/index.wxss b/pages/try/index/index.wxss
index 22c5874..14ace53 100644
--- a/pages/try/index/index.wxss
+++ b/pages/try/index/index.wxss
@@ -5,6 +5,7 @@
}
.try-container .header{
font-size: 52rpx;
+ line-height: 88rpx;
font-weight: bold;
display: flex;
align-items: center;
@@ -20,11 +21,15 @@
margin-top:20rpx;
position: relative;
overflow: hidden;
+ background-color: #eee;
}
.try-container .main .top-btn{
position: absolute;
- right:40rpx;top:40rpx;
+ right:20rpx;top:20rpx;
+ background-color: rgba(255, 255, 255, .6);
z-index: 100;
+ font-size: 28rpx;
+ box-shadow: 0px 6px 6px 1px rgba(0, 0, 0, 0.3);
}
.try-container .main .upload-btn{
width:100%;height:100%;
@@ -80,16 +85,18 @@
.try-container .main .item .image{
width:100%;height:100%;
}
-.try-container .main .share-area{
+.try-container .main .right-bottom-area{
+ position: absolute;
+ right:20rpx;bottom:20rpx;
+}
+.try-container .main .right-bottom-area .delete-area{
+ border-radius: 50%;
+ background-color: rgba(255, 255, 255, .7);
+ width:70rpx;height:70rpx;
display: flex;
align-items: center;
justify-content: center;
- font-size: 50rpx;
- color: #fff;
- margin-left:auto;
- background-color: rgba(0, 0, 0, .1);
- border-radius: 50%;
- width: 80rpx;height: 80rpx;
+ color: #666;
}
.try-container .bottom{
margin:40rpx 0 22rpx 0;
@@ -98,6 +105,13 @@
.history{
display: flex;
flex-wrap: nowrap;
+ gap: 20rpx;
+}
+.history .list{
+ display: flex;
+ flex-wrap: nowrap;
+ overflow: hidden;
+ flex: 1;
}
.history .item{
border-radius: 20rpx;
@@ -115,6 +129,14 @@
margin-left:16rpx;
margin-top:18rpx;
}
+.history .item .icon.more{
+ font-size: 60rpx;
+}
+.history .item.item-more{
+ font-size: 30rpx;
+ display: flex;
+ flex-direction: column;
+}
.history .item:first-child{
margin-left:0;
}
@@ -171,7 +193,7 @@
margin-top:-20rpx;
}
-.comment-modal-view .modal-view-main{
+/* .comment-modal-view .modal-view-main{
padding:0;
overflow: hidden;
}
@@ -204,13 +226,33 @@
.comment-modal-view .modal-view-main .close-btn-area .close-btn::before{
display: none;
}
-.comment-modal-view .modal-view-main .main-img{
+.comment-modal-view .modal-view-main .image-area{
width:100%;
- /* 54是弹出框左右的宽度 */
+ 54是弹出框左右的宽度
height:calc((100vw - 54px)*4/3);
+ position: relative;
+}
+.comment-modal-view .modal-view-main .image-area .image{
+ width:100%;height:100%;
+ vertical-align: middle;
+}
+.comment-modal-view .modal-view-main .image-area .top-bottom{
+ position: absolute;
+ bottom:20rpx;
+ left:20rpx;
+ display: flex;
+ flex-direction: column;
+ gap: 20rpx;
+}
+.comment-modal-view .modal-view-main .image-area .top,
+.comment-modal-view .modal-view-main .image-area .bottom{
+ width:140rpx;
+ height:140rpx;
+ border-radius: 20rpx;
}
.comment-modal-view .modal-view-main .comment{
padding:40rpx;
+ position: relative;
}
.comment-modal-view .modal-view-main .point{
display: flex;
@@ -241,4 +283,22 @@
}
.comment-modal-view .button{
margin-top:40rpx;
-}
\ No newline at end of file
+}
+
+@media (min-aspect-ratio:5/9){
+ .comment-modal-view .modal-view-main .comment{
+ padding:20rpx;
+ }
+ .comment-modal-view .modal-view-main .point{
+ position:absolute;
+ left:160rpx;
+ top:22rpx;
+ font-size: 40rpx;
+ }
+}
+@media (min-aspect-ratio:3/5){
+ .comment-modal-view .modal-view-main .image-area{
+ height:calc(100vw - 54px);
+ }
+} */
+
diff --git a/project.private.config.json b/project.private.config.json
index b98f2e8..f8d301f 100644
--- a/project.private.config.json
+++ b/project.private.config.json
@@ -9,7 +9,7 @@
"list": [
{
"name": "测试分享码",
- "pathName": "pages/my/login/index",
+ "pathName": "pages/try/index/index",
"query": "shared_user_code=ASSDJK",
"launchMode": "default",
"scene": null
@@ -17,12 +17,12 @@
{
"name": "测试分享穿搭",
"pathName": "pages/try/index/index",
- "query": "shared_history_id=33",
+ "query": "shared_history_id=44",
"launchMode": "default",
"scene": null
}
]
}
},
- "libVersion": "3.7.12"
+ "libVersion": "3.8.0"
}
\ No newline at end of file