index.vue 6.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }"
  3. :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  4. <tm-menubars title="添加穿搭" :shadow="0" :showback="true"></tm-menubars>
  5. <div class="zhuti">
  6. <!-- 衣橱 -->
  7. <tm-sheet class="yichu" style="margin-bottom: 40px !important;">
  8. <view class="flex-center"><tm-segTabs @change="shifouxuan" :round="24" :margin="[32,10]" font-size="s" :list="list" color="white" activeFontColor="red" bg-color="bg-gradient-red-lighten" v-model="active"></tm-segTabs></view>
  9. <view v-if="yixuanor==1" class="biaoti text-white mt-10 text-size-m"><view class="mr-10"></view>分类</view>
  10. <tm-tabs @change="fenlei" v-if="yixuanor==1" class="C1b1b1b qiehuan" color="white" align="left" v-model="activeIndexfl" :list="listfl" range-key="title"></tm-tabs>
  11. <view class="biaoti text-white mt-30 text-size-m"><view class="mr-10" v-if="yixuanor==0"></view>{{yixuanor==0?'场景':'请选择场景'}}</view>
  12. <tm-tabs @change="changjing" class="C1b1b1b qiehuan" color="white" align="left" v-model="activeIndexcj" :list="listcj" range-key="title"></tm-tabs>
  13. <view v-if="yixuanor==1" class="yiguicla black pa-6 ma-4 fl" @click="gaoliang(index,item)" :class="chooseindex==index?'C0178FD':''" v-for="(item,index) in quanbuList">
  14. <image :src="item.image" mode="widthFix"></image>
  15. <view class="text-size-m mt-20 mb-20 ml-10">{{item.title}}</view>
  16. </view>
  17. <view v-if="yixuanor==0" class="yiguicla black pa-6 ma-4 fl" @click="gaoliang(index,item)" :class="chooseindex==index?'C0178FD':''" v-for="(item,index) in yixuanList">
  18. <image :src="item.image" mode="widthFix"></image>
  19. <view class="text-size-m mt-20 mb-20 ml-10">{{item.title}}</view>
  20. </view>
  21. <tm-empty v-if="yixuanor==0 && yixuanList.length ==0" label="暂无数据" color="white" icon="icon-paperplane-fill"></tm-empty>
  22. <view style="clear: both;"></view>
  23. <!-- <view style="clear: both;" class="more ma-30 pt-40" @click="gengmore()">
  24. <image src="/static/img/30.png" mode="widthFix"></image>
  25. <text class="text-size-s">下拉加载更多~</text>
  26. </view> -->
  27. </tm-sheet>
  28. <tm-button v-if="yixuanor==0 && yixuanList.length !=0" theme="gray" :round="24" class="sao mb-40" block>删除</tm-button>
  29. <tm-button v-if="yixuanor==1" :round="24" class="sao mb-40" block>保存</tm-button>
  30. </div>
  31. <!-- 弹出层消息 -->
  32. <tm-message ref="toast"></tm-message>
  33. </view>
  34. </template>
  35. <script>
  36. import{myRequest} from '@/api/request.js'
  37. export default {
  38. data() {
  39. return {
  40. listflall:[],
  41. listcjall:[],
  42. listfl:[],
  43. yixuanor:0,//0已选
  44. list:['已选穿搭','可选穿搭'],
  45. listcj:[],
  46. active:0,
  47. activeIndexfl:0,
  48. activeIndexcj:0,
  49. quanbuList:[],
  50. yixuanList:[],
  51. chooseindex:-1
  52. };
  53. },
  54. onLoad() {
  55. },
  56. created() {
  57. this.sys = uni.getSystemInfoSync();
  58. this.getFl();
  59. this.getCj();
  60. },
  61. methods: {
  62. fenlei(e){
  63. var id=this.listflall[e].id;
  64. this.getKxuan(id)
  65. },
  66. changjing(e){
  67. var id=this.listcjall[e].id;
  68. this.getYxuan(id)
  69. },
  70. shifouxuan(e){
  71. this.activeIndexcj=0;
  72. this.chooseindex=-1;
  73. this.yixuanor=e;
  74. if(e==0){
  75. var id=this.listcjall[0].id;
  76. this.getYxuan(id)
  77. }
  78. },
  79. getYxuan(id){
  80. var that=this;
  81. myRequest({
  82. url: "/api/Collocation/getAppointmentMatching",
  83. method:'post',
  84. data:{scene_id:id}
  85. }).then(res => {
  86. if (res.data.code == 200) {
  87. if(res.data.data.length != 0){
  88. that.quanbuList=res.data.data;
  89. }
  90. }else{
  91. that.quanbuList=[];
  92. }
  93. })
  94. },
  95. getKxuan(id){
  96. var that=this;
  97. myRequest({
  98. url: "/api/Collocation/getPlanTomorrow",
  99. method:'post',
  100. data:{id:id}
  101. }).then(res => {
  102. if (res.data.code == 200) {
  103. if(res.data.data.length != 0){
  104. that.quanbuList=res.data.data;
  105. }
  106. }else{
  107. that.quanbuList=[];
  108. }
  109. })
  110. },
  111. getCj(){
  112. var that=this;
  113. myRequest({
  114. url: "/api/Scene/sceneList",
  115. method:'post',
  116. data:{}
  117. }).then(res => {
  118. if (res.data.code == 200) {
  119. if(res.data.data.length != 0){
  120. // that.listfl=['全部'];
  121. for(let i=0;i<res.data.data.length;i++){
  122. that.listcj.push(res.data.data[i].scene_name)
  123. }
  124. that.listcjall=res.data.data;
  125. that.getYxuan(that.listcjall[0].id)
  126. }
  127. }else{
  128. that.listcj=[];
  129. }
  130. })
  131. },
  132. getFl(){
  133. var that=this;
  134. myRequest({
  135. url: "/api/Category/getCollocationClassList",
  136. method:'post',
  137. data:{}
  138. }).then(res => {
  139. if (res.data.code == 200) {
  140. if(res.data.data.length != 0){
  141. // that.listfl=['全部'];
  142. for(let i=0;i<res.data.data.length;i++){
  143. that.listfl.push(res.data.data[i].category_name)
  144. }
  145. that.listflall=res.data.data;
  146. that.getKxuan(that.listflall[0].id);
  147. }
  148. }else{
  149. that.listfl=[];
  150. }
  151. })
  152. },
  153. gengmore(){
  154. },
  155. gaoliang(index){
  156. this.chooseindex=index
  157. }
  158. },
  159. }
  160. </script>
  161. <style lang="scss">
  162. /deep/ .tm-menubars .body{
  163. background-color: #1b1b1b !important;
  164. }
  165. /deep/ .qiehuan1 .text-primary{color: white !important;}
  166. .chuanda{width: 100%;height: 144px;}
  167. .taiyang{width: 25px;}
  168. .bianji{border: 1px solid #303440;width: 80px;height: 30px;background: #303440;font-size: 15px;
  169. text-align: center;line-height: 30px;border-radius: 5px;margin: 0 auto;margin-top: 10px;border:1px solid white;}
  170. .scroll-view_H {
  171. white-space: nowrap;
  172. width: 100%;
  173. background: #1B1B1B;
  174. padding-bottom: 15px;
  175. }
  176. .scroll-view-item {
  177. height: 300rpx;
  178. text-align: center;
  179. font-size: 36rpx;
  180. }
  181. .scroll-view-item_H {
  182. display: inline-block;
  183. width: 150px;
  184. text-align: center;
  185. font-size: 36rpx;
  186. margin-left: 10px;
  187. background: #0D0D0D;
  188. padding: 6px;
  189. border-radius: 10px;
  190. }
  191. .yichu{margin:0 !important;padding: 4px !important;margin-top: 10px !important;}
  192. /deep/ .qiehuan .text-white{
  193. font-size: 14px;
  194. background: #303440;
  195. height: 28px;
  196. vertical-align: middle;
  197. line-height: 28px;
  198. border-radius: 20px;
  199. padding-left: 14px;
  200. padding-right: 14px;
  201. margin-top: 17%;
  202. }
  203. /deep/ .qiehuan .tm-tabs-con-item-border{display: none;}
  204. .yiguicla image{width: 95%;display: block;margin: 0 auto;margin-top: 5px;}
  205. .yiguicla{width: 47%;border-radius: 10px;}
  206. .more{text-align: center;}
  207. .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
  208. .fudong{position:fixed;right:10px;bottom:150px;background: #303030;width: 130px;height: 60px;
  209. border-radius: 30px 0px 0px 30px;font-size: 14px;text-align: center;}
  210. .sao{width: 60%;display: block;margin: 0 auto;margin-bottom: 60px;}
  211. .biaoti view{width:5px;height:19px;background: #0178FD;float: left;border-radius: 10px;}
  212. </style>