sellerRegulations.vue 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441
  1. <template name="regulations">
  2. <view class="regulations-template">
  3. <view class="regulations-title" @tap.stop="hanldOperationConfim">
  4. <text class="text">售后条款</text>
  5. <view class="freight-right">
  6. <text class="text-l">{{regulaText}}</text>
  7. <text class="iconfont icon-xiayibu"></text>
  8. </view>
  9. </view>
  10. <!--底部选择模态层弹窗组件 -->
  11. <view class="popup spec" :class="specClass" @touchmove.stop.prevent="discard" >
  12. <!-- 遮罩层 -->
  13. <view class="mask"></view>
  14. <view class="layer">
  15. <view class="content">
  16. <view class="freight-ltitle">售后条款</view>
  17. <text class="iconfont icon-iconfontguanbi" @click="freightConfim"></text>
  18. <view class="freight-radio">
  19. <radio-group class="row-group" @change="radioChange">
  20. <label class="row-input">
  21. <view class="row-text noTk">无条款</view>
  22. <radio class="row-radio" value="无条款" color="#E15616"/>
  23. </label>
  24. <label class="row-input" v-for="(item, index) in regulaDatas" :key="index">
  25. <view class="row-text" @click.stop="gotoConten(item.id)">{{item.name.length>15?item.name.substr(0,15)+'...':item.name}}</view>
  26. <radio class="row-radio" :value="item.name" :checked="index === current" color="#E15616"/>
  27. </label>
  28. </radio-group>
  29. </view>
  30. </view>
  31. <view class="btn">
  32. <view class="button add" @click="freightConfim">确定</view>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. </template>
  38. <script>
  39. export default{
  40. name:'regulations',
  41. props:{
  42. regulaDatas:{
  43. type:Array
  44. }
  45. },
  46. data(){
  47. return{
  48. regulaText:'无条款',
  49. freightMoney:0,
  50. specClass: '',//规格弹窗css类,控制开关动画
  51. }
  52. },
  53. watch: {
  54. regulaDatas: {
  55. handler: function (el) {//监听对象的变换使用 function,箭头函数容易出现this指向不正确
  56. this.regulaDatas = el
  57. },
  58. deep: true
  59. }
  60. },
  61. created() {
  62. },
  63. methods:{
  64. gotoConten(id){
  65. console.log(id)
  66. this.$api.navigateTo(`/pages/service/sellconten?id=${id}`)
  67. },
  68. radioChange(e){
  69. this.regulaText = e.target.value;
  70. },
  71. freightConfim(){//提交完成选择
  72. this.hideSpec()
  73. },
  74. hideSpec() {//关闭弹窗
  75. this.specClass = 'hide';
  76. setTimeout(() => {
  77. this.specClass = 'none';
  78. }, 200);
  79. },
  80. hanldOperationConfim(data){//显示弹窗
  81. this.specClass = 'show';
  82. this.freightMoney = this.hanldFreight
  83. },
  84. showTip(){//显示弹窗
  85. this.$emit('@showregulaAlert');
  86. },
  87. }
  88. }
  89. </script>
  90. <style lang="scss">
  91. .regulations-template{
  92. width: 100%;
  93. height: auto;
  94. background: #FFFFFF;
  95. float: left;
  96. margin-top: 24rpx;
  97. .regulations-title{
  98. width: 702rpx;
  99. padding: 0 24rpx;
  100. height: 88rpx;
  101. line-height: 88rpx;
  102. font-size: $font-size-28;
  103. color: $text-color;
  104. background: #FFFFFF;
  105. float: left;
  106. font-weight: bold;
  107. border-bottom: 1rpx solid #EBEBEB;
  108. .freight-left{
  109. float: left;
  110. .icon-yunfeishuoming{
  111. height: 100%;
  112. padding:15rpx;
  113. color: $color-system;
  114. font-weight: normal;
  115. }
  116. }
  117. .Tk{
  118. float: right;
  119. margin-right: 38rpx;
  120. font-size: $font-size-28;
  121. color: #666666;
  122. }
  123. .freight-right{
  124. float: right;
  125. color: #2A81FF;
  126. .text-l{
  127. margin-right: 20rpx;
  128. }
  129. .text{
  130. line-height: 88rpx;
  131. color: #ff0000;
  132. margin:0 20rpx;
  133. font-weight: normal;
  134. }
  135. .icon-xiayibu{
  136. line-height: 88rpx;
  137. color: #999999;
  138. font-weight: normal;
  139. }
  140. }
  141. }
  142. }
  143. .freight-ltitle{
  144. width: 100%;
  145. line-height: 60rpx;
  146. height: 60rpx;
  147. font-size: $font-size-34;
  148. color: #333333;
  149. text-align:center;
  150. }
  151. .icon-iconfontguanbi{
  152. position: absolute;
  153. top: 0;
  154. right: 0;
  155. font-size: 34rpx;
  156. color: #b2b2b2
  157. }
  158. .freight-radio{
  159. height: 66rpx;
  160. line-height: 66rpx;
  161. padding: 0 20rpx;
  162. .row-group{
  163. width: 100%;
  164. max-height: 460rpx;
  165. overflow: auto;
  166. }
  167. .row-input{
  168. height: 66rpx;
  169. line-height: 66rpx;
  170. width: 100%;
  171. display: block;
  172. }
  173. .row-radio{
  174. float: right;
  175. transform: scale(0.9);
  176. color: #b2b2b2;
  177. }
  178. .row-text{
  179. font-size: $font-size-28;
  180. color: #1890f9;
  181. float: left;
  182. &.noTk{
  183. color: #666666;
  184. }
  185. }
  186. }
  187. .freight-group{
  188. width: 100%;
  189. height: 88rpx;
  190. display: flex;
  191. border-bottom: 1px solid #FFFFFF;
  192. flex-direction: row;
  193. .text{
  194. display: block;
  195. flex: 1;
  196. line-height: 88rpx;
  197. font-size: $font-size-24;
  198. color: #999999;
  199. text-align: left;
  200. padding-left: 10rpx;
  201. }
  202. .group-from{
  203. flex: 1;
  204. height: 40rpx;
  205. padding: 20rpx;
  206. line-height: 40rpx;
  207. align-items: flex-start;
  208. font-size: $font-size-24;
  209. color: $text-color;
  210. background: #F7F7F7;
  211. border-radius: 14rpx;
  212. margin-bottom: 20rpx;
  213. margin-top: 10rpx;
  214. .form-input{
  215. height: 40rpx;
  216. line-height: 40rpx;
  217. flex-grow: 1;
  218. }
  219. }
  220. }
  221. /* 加入购物模态层*/
  222. @keyframes showPopup {
  223. 0% {
  224. opacity: 0;
  225. }
  226. 100% {
  227. opacity: 1;
  228. }
  229. }
  230. @keyframes hidePopup {
  231. 0% {
  232. opacity: 1;
  233. }
  234. 100% {
  235. opacity: 0;
  236. }
  237. }
  238. @keyframes showLayer {
  239. 0% {
  240. transform: translateY(0);
  241. }
  242. 100% {
  243. transform: translateY(-100%);
  244. }
  245. }
  246. @keyframes hideLayer {
  247. 0% {
  248. transform: translateY(-100%);
  249. }
  250. 100% {
  251. transform: translateY(0);
  252. }
  253. }
  254. @keyframes showAmnation {
  255. 0% {
  256. top: -12rpx;
  257. opacity: 0;
  258. }
  259. 50% {
  260. top: -60rpx;
  261. opacity: 1;
  262. }
  263. 100% {
  264. top: -100rpx;
  265. opacity: 0;
  266. }
  267. }
  268. @keyframes hideAmnation {
  269. 0% {
  270. top: -100rpx;
  271. opacity: 0;
  272. }
  273. 100% {
  274. top: -12rpx;
  275. opacity: 0;
  276. }
  277. }
  278. .popup {
  279. position: fixed;
  280. top: 0;
  281. width: 100%;
  282. height: 100%;
  283. z-index: 999;
  284. display: none;
  285. .mask{
  286. position: fixed;
  287. top: 0;
  288. width: 100%;
  289. height: 100%;
  290. z-index: 21;
  291. background-color: rgba(0, 0, 0, 0.6);
  292. }
  293. .layer {
  294. position: fixed;
  295. z-index: 22;
  296. bottom: -710rpx;
  297. width: 702rpx;
  298. padding: 24rpx 24rpx 36rpx 24rpx;
  299. height: 670rpx;
  300. border-radius: 20rpx 20rpx 0 0;
  301. background-color: #fff;
  302. display: flex;
  303. flex-wrap: wrap;
  304. align-content: space-between;
  305. .content {
  306. width: 100%;
  307. position: relative;
  308. }
  309. .btn {
  310. width: 100%;
  311. height: 88rpx;
  312. display: flex;
  313. .button {
  314. width: 702rpx;
  315. height: 88rpx;
  316. color: #fff;
  317. display: flex;
  318. align-items: center;
  319. justify-content: center;
  320. font-size: $font-size-28;
  321. border-radius: 14rpx;
  322. background: $btn-confirm;
  323. }
  324. }
  325. }
  326. &.show {
  327. display: block;
  328. .mask{
  329. animation: showPopup 0.2s linear both;
  330. }
  331. .layer {
  332. animation: showLayer 0.2s linear both;
  333. }
  334. }
  335. &.hide {
  336. display: block;
  337. .mask{
  338. animation: hidePopup 0.2s linear both;
  339. }
  340. .layer {
  341. animation: hideLayer 0.2s linear both;
  342. }
  343. }
  344. &.none {
  345. display: none;
  346. }
  347. &.service {
  348. .row {
  349. margin: 30upx 0;
  350. .title {
  351. font-size: 30upx;
  352. margin: 10upx 0;
  353. }
  354. .description {
  355. font-size: 28upx;
  356. color: #999;
  357. }
  358. }
  359. }
  360. .layer-smimg{
  361. width: 114rpx;
  362. height: 114rpx;
  363. float: left;
  364. border-radius: 10rpx;
  365. margin-right: 24rpx;
  366. image{
  367. width: 114rpx;
  368. height: 114rpx;
  369. border-radius: 10rpx;
  370. }
  371. }
  372. .layer-nunbox{
  373. justify-content: space-between;
  374. align-items: center;
  375. width: 536rpx;
  376. height: 88rpx;
  377. padding: 13rpx 0 0 0;
  378. float: left;
  379. .layer-nunbox-t{
  380. width: 100%;
  381. height:44rpx;
  382. position:relative;
  383. display: flex;
  384. .layer-nunbox-text{
  385. line-height: 44rpx;
  386. font-size: $font-size-28;
  387. }
  388. .number-box{
  389. display: flex;
  390. justify-content: center;
  391. align-items: center;
  392. .iconfont{
  393. font-size: $font-size-32;
  394. padding:0 20rpx;
  395. font-size: $text-color;
  396. }
  397. .btn-input{
  398. width: 62rpx;
  399. height: 48rpx;
  400. line-height: 48rpx;
  401. background: #F8F8F8;
  402. border-radius: 4rpx;
  403. text-align: center;
  404. font-size: $font-size-28;
  405. }
  406. }
  407. .product-step{
  408. position: absolute;
  409. left: 45rpx;
  410. bottom: 0;
  411. height: 44rpx;
  412. background: #FFFFFF;
  413. }
  414. }
  415. .layer-nunbox-b{
  416. width: 100%;
  417. height:44rpx;
  418. margin-top: 13rpx;
  419. }
  420. .text{
  421. line-height: 44rpx;
  422. font-size: $font-size-28;
  423. .p{
  424. color: #FF2A2A;
  425. }
  426. .p:first-child{
  427. margin-left: 30rpx;
  428. }
  429. .p.sm{
  430. font-size: $font-size-24;
  431. }
  432. }
  433. }
  434. }
  435. </style>