index.vue 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273
  1. <template>
  2. <view :style="{ minHeight: sys.windowHeight + 'px' }" :class="[$tm.vx.state().tmVuetify.black ? 'black' : ' ']">
  3. <tm-menubars title="衣柜" :shadow="0" :showback="true"></tm-menubars>
  4. <view class="C1b1b1b">
  5. <view class="dingwei ml-20" v-if="itemuser!=0">
  6. <image class="touxiang" style="vertical-align: middle;" src="/static/img/41.png" mode="widthFix"></image>
  7. <text style="vertical-align: middle;" class="text-size-m mr-20">{{itemuser.username}}的衣橱</text>
  8. <!-- <image @click="qiehuanFun" style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image> -->
  9. <!-- <text @click="qiehuanFun" style="vertical-align: middle;" class="text-size-m">切换</text> -->
  10. </view>
  11. <view class="dingwei" v-if="itemuser==0">
  12. <text style="vertical-align: middle;" class="text-size-m mr-20">暂无家庭成员去添加</text>
  13. <image @click="tianjia" style="vertical-align: middle;" src="/static/img/42.png" mode="widthFix"></image>
  14. </view>
  15. </view>
  16. <!-- 推荐 -->
  17. <view class="zhuti">
  18. <!-- 衣橱 -->
  19. <tm-sheet class="yichu" style="margin-bottom: 70px !important;">
  20. <tm-tabs class="C1b1b1b qiehuan" @change="fenleichange" color="white" align="left" v-model="activeIndex" :list="list" range-key="title"></tm-tabs>
  21. <view class="yiguicla black pa-6 ma-4 fl" :class="item.off?'C0178FD':''" v-for="(item,index) in quanbuList" @click="yifu(index,item)">
  22. <image :src="item.src" mode="widthFix"></image>
  23. <view class="text-align-center text-size-m mt-8">{{item.text}}</view>
  24. <view class="text-align-center text-size-m mt-6 mb-6">{{item.type}}</view>
  25. </view>
  26. <view style="clear: both;" class="more ma-30 pt-40" @click="gengmore()">
  27. <image src="/static/img/30.png" mode="widthFix"></image>
  28. <text class="text-size-s">下拉加载更多~</text>
  29. </view>
  30. </tm-sheet>
  31. <view class="anniu">
  32. <tm-button @click="quxiao" :round="24" class="fl" theme="gray" size="n">取消</tm-button>
  33. <tm-button :round="24" class="fl" theme="primary" size="n">取出</tm-button>
  34. </view>
  35. <view class="anniu">
  36. <tm-button :round="24" class="fl" theme="red" size="n">删除</tm-button>
  37. <tm-button :round="24" class="fl" theme="primary" size="n">保存</tm-button>
  38. </view>
  39. </view>
  40. </view>
  41. </template>
  42. <script>
  43. import{myRequest} from '@/api/request.js'
  44. export default {
  45. data() {
  46. return {
  47. itemuser:0,
  48. soso:'',
  49. activeIndex:0,
  50. list:[],
  51. listlx:[],
  52. quanbuList:[{
  53. src:'/static/img/45.png',
  54. text:'NEO CITY 涂鸦',
  55. type:'手提包',
  56. off:false
  57. },{
  58. src:'/static/img/46.png',
  59. text:'满印迷你标识',
  60. type:'围巾',
  61. off:false
  62. },{
  63. src:'/static/img/47.png',
  64. text:'大号版型夹克',
  65. type:'新品',
  66. off:false
  67. },{
  68. src:'/static/img/45.png',
  69. text:'NEO CITY 涂鸦',
  70. type:'手提包',
  71. off:false
  72. },{
  73. src:'/static/img/46.png',
  74. text:'满印迷你标识',
  75. type:'围巾',
  76. off:false
  77. },{
  78. src:'/static/img/47.png',
  79. text:'大号版型夹克',
  80. type:'新品',
  81. off:false
  82. }],
  83. chooseindex:-1
  84. };
  85. },
  86. onLoad() {
  87. console.log("111")
  88. },
  89. created() {
  90. this.sys = uni.getSystemInfoSync();
  91. console.log("222")
  92. // this.getfenltext()
  93. this.fenleichange();
  94. },
  95. methods: {
  96. quxiao(){
  97. for(let i=0;i<this.quanbuList.length;i++){
  98. this.quanbuList[i].off=false;
  99. }
  100. },
  101. chuku(){
  102. uni.navigateTo({
  103. url: "/pages/quchu/index",
  104. })
  105. },
  106. sosoFun(){
  107. uni.navigateTo({
  108. url: "/pages/shopsoso/index",
  109. })
  110. },
  111. fenleichange(e){
  112. var that=this;
  113. myRequest({
  114. url: "/api/MemberInfo/getFamilyMember",
  115. method:'post',
  116. data:{family_id:uni.getStorageSync("family_id")}
  117. }).then(res => {
  118. console.log(res.data)
  119. if (res.data.code == 200) {
  120. if(res.data.data.length != 0){
  121. var wu=0;
  122. for(let i=0;i<res.data.data.length;i++){
  123. if(res.data.data[i].checked==1){
  124. wu=1;
  125. that.itemuser=res.data.data[i];
  126. }
  127. }
  128. if(wu==0){
  129. that.itemuser=res.data.data[0];
  130. }
  131. }else{
  132. that.itemuser=0;
  133. }
  134. }else{
  135. that.itemuser=0;
  136. }
  137. })
  138. },
  139. getfenltext(){
  140. var that=this;
  141. myRequest({
  142. url: "/api/Category/list",
  143. method:'post',
  144. data:{}
  145. }).then(res => {
  146. console.log(res.data)
  147. if (res.data.code == 200) {
  148. if(res.data.data.length != 0){
  149. that.list=['全部'];
  150. for(let i=0;i<res.data.data.length;i++){
  151. that.list.push(res.data.data[i].category_name)
  152. }
  153. that.listlx=res.data.data;
  154. }
  155. }else{
  156. that.list=[];
  157. that.listlx=[];
  158. }
  159. })
  160. },
  161. yifu(index,item){
  162. item.off=! item.off
  163. console.log(item)
  164. },
  165. qiehuanFun(){
  166. uni.navigateTo({
  167. url: "/pages/qiehuan/index",
  168. })
  169. },
  170. randouh(){
  171. let list2 = [],that=this;
  172. for(let i=0;i<6;i++){
  173. list2.push({
  174. src:'/static/img/47.png',
  175. text:'大号版型夹克',
  176. type:'新品',
  177. off:false
  178. })
  179. }
  180. this.quanbuList=this.quanbuList.concat(list2)
  181. console.log(this.quanbuList)
  182. },
  183. gengmore(){
  184. this.randouh()
  185. },
  186. change(e){
  187. uni.$tm.toast(`你选中了${e}`);
  188. },
  189. changece(e){
  190. uni.$tm.toast(`您选中了:${e}`)
  191. },
  192. dapei(item){
  193. console.log(item)
  194. },
  195. xiangqing(item){
  196. console.log(item)
  197. },
  198. ruku(){
  199. uni.navigateTo({
  200. url: "/pages/putstorage/index",
  201. })
  202. },
  203. tianjia(){
  204. uni.navigateTo({
  205. url: "/pages/chuanghome/index",
  206. })
  207. }
  208. },
  209. }
  210. </script>
  211. <style lang="scss">
  212. /deep/ uni-scroll-view{
  213. height: auto !important;
  214. }
  215. /deep/ .tm-menubars .body{
  216. background-color: #1b1b1b !important;
  217. }
  218. .shangright{
  219. padding: 10px;
  220. }
  221. //
  222. .xiangji image{
  223. width: 30px;
  224. height: 22px;
  225. }
  226. .suosou image{
  227. width: 40px;
  228. }
  229. /deep/ .icon-search{
  230. font-size: 23px !important;
  231. color: #8E8E93 !important;
  232. }
  233. /deep/ .tm-search{
  234. width: 94%;
  235. margin: 0 auto;
  236. background-color: #414141 !important;
  237. border-radius: 10px;
  238. }
  239. /deep/ .tm-search .grey-darken-5{
  240. background-color: #414141 !important;
  241. }
  242. .dingwei{padding-bottom: 20px;}
  243. .dingwei image{width: 25px;margin-right: 10px; }
  244. .dingwei .touxiang{width: 50px;margin-right: 3px; }
  245. /deep/ .lunbo1{margin:0 !important;padding: 4px !important;margin-top: 5px !important;width: 46.6% !important;}
  246. .tuijiantp{width: 100%;}
  247. .tuijiantp image{width: 97% !important;}
  248. .yichu{margin:0 !important;padding: 4px !important;margin-top: 10px !important;}
  249. /deep/ .qiehuan .text-white{
  250. font-size: 14px;
  251. background: #303440;
  252. height: 28px;
  253. vertical-align: middle;
  254. line-height: 28px;
  255. border-radius: 20px;
  256. padding-left: 14px;
  257. padding-right: 14px;
  258. margin-top: 17%;
  259. }
  260. /deep/ .qiehuan .tm-tabs-con-item-border{display: none;}
  261. .yiguicla image{width: 95%;display: block;margin: 0 auto;margin-top: 5px;}
  262. .yiguicla{width: 30%;border-radius: 10px;}
  263. .more{text-align: center;}
  264. .more image{margin-right: 10px;vertical-align: middle;width: 30px;}
  265. .fudong{position:fixed;right:10px;bottom:150px;background: #303030;width: 130px;height: 60px;
  266. border-radius: 30px 0px 0px 30px;font-size: 14px;text-align: center;}
  267. .fudimg{width: 60px;height:60px}
  268. .anniu{width: 78%;margin: 0 auto;margin-top: 20px;padding-bottom: 30px;text-align: center;}
  269. /deep/ .tm-button .tm-button-btn uni-button{min-width: 120px !important;}
  270. /deep/ .tm-button .red{color: white !important;}
  271. </style>