ckmusic.vue 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <view class="content">
  3. <view class="content2">
  4. <view class="shopBox">
  5. <view class="shopLine" v-for="(item,index) in list" @click="ckshop(item,index)">
  6. <img src="../../static/img/ckn.png" alt="" class="ckImg" v-if="ckIndex!=index">
  7. <img src="../../static/img/cky.png" alt="" class="ckImg" v-if="ckIndex==index">
  8. <view class="shopName">{{item.name}}</view>
  9. </view>
  10. </view>
  11. </view>
  12. <view class="bottom" @click="determine">
  13. 确定添加
  14. </view>
  15. </view>
  16. </template>
  17. <script>
  18. export default {
  19. data() {
  20. return {
  21. list:'',
  22. allck:false,
  23. ckIndex:0,
  24. }
  25. },
  26. onLoad() {
  27. this.getShopList()
  28. },
  29. methods: {
  30. determine(){
  31. var ckmusic=this.list[this.ckIndex];
  32. console.log(ckmusic)
  33. uni.setStorage({
  34. key: 'ckmusic',
  35. data: ckmusic,
  36. success: function () {
  37. uni.navigateBack(-1)
  38. }
  39. });
  40. },
  41. ckshop(item,index){
  42. this.ckIndex=index
  43. },
  44. getShopList(){
  45. uni.showLoading({
  46. title: '加载中'
  47. })
  48. this.$http('openH5SetTheGuest/selectMusic', {
  49. },'GET').then(res => {
  50. uni.hideLoading();
  51. this.list=res.data;
  52. //console.log(this.list)
  53. })
  54. }
  55. }
  56. }
  57. </script>
  58. <style scoped>
  59. .content{
  60. min-height: 100vh;
  61. background:#F4F5F7;
  62. }
  63. .shopBox{
  64. background: #ffffff;
  65. border-radius: 10rpx;
  66. }
  67. .content2{
  68. padding: 20rpx 24rpx;
  69. }
  70. .shopLine{
  71. display: flex;
  72. padding: 30rpx 20rpx;
  73. border-bottom: 1px solid #EEEEEE;
  74. }
  75. .ckImg{
  76. width: 44rpx;
  77. height: 44rpx;
  78. }
  79. .shopName{
  80. color: #3C3C3C;
  81. line-height: 44rpx;
  82. font-size: 28rpx;
  83. padding-left: 26rpx;
  84. }
  85. .bottom{
  86. width: 750rpx;
  87. height: 98rpx;
  88. background: #3F90F7;
  89. line-height: 98rpx;
  90. text-align: center;
  91. color: #ffffff;
  92. font-size: 30rpx;
  93. position: fixed;
  94. left: 0;
  95. bottom: 0;
  96. }
  97. .bottomLeft{
  98. display: flex;
  99. padding-top: 38rpx;
  100. padding-left: 24rpx;
  101. }
  102. .allTxt{
  103. line-height: 44rpx;padding-left: 12rpx;color: #3C3C3C;
  104. }
  105. .determine{
  106. width: 310rpx;
  107. height: 98rpx;
  108. background: #3F90F7;
  109. border-radius: 10rpx;
  110. font-weight: 500;
  111. color: #FFFFFF;
  112. font-size: 31rpx;
  113. line-height: 98rpx;
  114. text-align: center;
  115. margin-top: 11rpx;
  116. margin-right: 24rpx;
  117. }
  118. </style>